Skip to content

Commit 76e4f01

Browse files
authored
Merge branch 'main' into postperpage_query
2 parents 3ba3f7f + d58b5c5 commit 76e4f01

20 files changed

+17
-3
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,7 @@ public/feed.xml
3838
public/sitemap.xml
3939
public/robots.txt
4040

41+
public/images/og
42+
4143
# VSCode settings
42-
.vscode/
44+
.vscode/

next.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ module.exports = withPlugins([[indexSearch], [feed], [sitemap], [socialImages]],
2525
// TODO: remove and throw warning if used instead of WORDPRESS_GRAPHQL_ENDPOINT
2626

2727
WORDPRESS_HOST: removeLastTrailingSlash(process.env.WORDPRESS_HOST),
28+
29+
// The image directory for open graph images will be saved at the location above
30+
// with `public` prepended. By default, images will be saved at /public/images/og
31+
// and available at /images/og. If changing, make sure to update the .gitignore
32+
33+
OG_IMAGE_DIRECTORY: '/images/og',
34+
2835
},
2936
});
3037

plugins/socialImages.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ const WebpackPluginCompiler = require('./plugin-compiler');
88
const pkg = require('../package.json');
99

1010
module.exports = function sitemap(nextConfig = {}) {
11-
const { env, outputDirectory = './public/images', outputName = '[slug].png', verbose = false } = nextConfig;
11+
const {
12+
env,
13+
outputDirectory = `./public${nextConfig.env.OG_IMAGE_DIRECTORY}`,
14+
outputName = '[slug].png',
15+
verbose = false,
16+
} = nextConfig;
1217

1318
const width = 1012;
1419
const height = 506;
Binary file not shown.
-19.4 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-23.1 KB
Binary file not shown.
-21.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)