Skip to content

Commit 6434407

Browse files
authored
build(sitemap): add build step for generating site map (#56)
1 parent cd20eb8 commit 6434407

File tree

4 files changed

+34
-19
lines changed

4 files changed

+34
-19
lines changed

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
enable-pre-post-scripts=true

next-sitemap.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/** @type {import('next-sitemap').IConfig} */
2+
module.exports = {
3+
siteUrl: process.env.SITE_URL || 'https://sophia-dev.io',
4+
generateRobotsTxt: true,
5+
exclude: ['/*/404', '/*/500', '/404', '/500'],
6+
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"scripts": {
66
"dev": "next dev",
77
"build": "next build",
8+
"postbuild": "next-sitemap",
89
"start": "next start",
910
"lint": "next lint",
1011
"album": "TS_NODE_PROJECT=./tsconfig.node.json ts-node ./scripts/album.ts",
@@ -29,6 +30,7 @@
2930
"lodash": "^4.17.21",
3031
"next": "14.1.0",
3132
"next-mdx-remote": "^4.4.1",
33+
"next-sitemap": "^4.2.3",
3234
"next-translate": "^2.6.2",
3335
"react": "^18",
3436
"react-dom": "^18",

pnpm-lock.yaml

Lines changed: 25 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)