aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-02-13 18:46:38 +0100
committerArmand Philippot <git@armandphilippot.com>2022-02-13 19:12:28 +0100
commitd7df049ef40d4028ac5616f8bbe366d1476404de (patch)
treefccf00f215652edfdf944e470c83772922b39d20
parent43f1fc3ce52e6ddd397853964c8868f2f4eee41d (diff)
feat: add a sitemap
-rw-r--r--.gitignore4
-rw-r--r--next-sitemap.js9
-rw-r--r--package.json2
-rw-r--r--yarn.lock13
4 files changed, 28 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 182fe2d..cc7b36b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,3 +45,7 @@ yarn-error.log*
# i18n
lang
+
+# Files generated each build
+/public/sitemap*.xml
+/public/robots.txt
diff --git a/next-sitemap.js b/next-sitemap.js
new file mode 100644
index 0000000..9f7346d
--- /dev/null
+++ b/next-sitemap.js
@@ -0,0 +1,9 @@
+/** @type {import('next-sitemap').IConfig} */
+
+module.exports = {
+ siteUrl: process.env.NEXT_PUBLIC_FRONTEND_URL,
+ generateRobotsTxt: true,
+ changefreq: null,
+ priority: null,
+ exclude: ['/feed.xml', '/feed.json', '/atom.xml'],
+};
diff --git a/package.json b/package.json
index 7643e18..de0ca1d 100644
--- a/package.json
+++ b/package.json
@@ -22,6 +22,7 @@
"dev": "next dev",
"prebuild": "npm run i18n:compile",
"build": "next build",
+ "postbuild": "next-sitemap",
"start": "next start",
"lint": "next lint",
"i18n:compile": "formatjs compile-folder src/i18n lang/",
@@ -77,6 +78,7 @@
"husky": "^7.0.4",
"jest": "^27.4.4",
"lint-staged": "^12.1.2",
+ "next-sitemap": "^2.1.14",
"prettier": "^2.5.1",
"react-test-renderer": "^17.0.2",
"sass": "^1.45.0",
diff --git a/yarn.lock b/yarn.lock
index 1de517f..834ed93 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1150,6 +1150,11 @@
dependencies:
chalk "^4.0.0"
+"@corex/deepmerge@^2.6.148":
+ version "2.6.148"
+ resolved "https://registry.yarnpkg.com/@corex/deepmerge/-/deepmerge-2.6.148.tgz#8fa825d53ffd1cbcafce1b6a830eefd3dcc09dd5"
+ integrity sha512-6QMz0/2h5C3ua51iAnXMPWFbb1QOU1UvSM4bKBw5mzdT+WtLgjbETBBIQZ+Sh9WvEcGwlAt/DEdRpIC3XlDBMA==
+
"@cspotcode/source-map-consumer@0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz#33bf4b7b39c178821606f669bbc447a6a629786b"
@@ -6169,6 +6174,14 @@ neo-async@^2.6.0:
resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f"
integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==
+next-sitemap@^2.1.14:
+ version "2.1.14"
+ resolved "https://registry.yarnpkg.com/next-sitemap/-/next-sitemap-2.1.14.tgz#d800a85c2d045dfdfe8982c8fdb3304087950515"
+ integrity sha512-7IqZjCGYSoA7csSc7B3m3m7hlFYd7Csg2PrNX97wH6/yJZ58nXiBR2JYQhHOZE3CzP3BAUKxwhiv2SlDiRzNXA==
+ dependencies:
+ "@corex/deepmerge" "^2.6.148"
+ minimist "^1.2.5"
+
next-themes@^0.0.15:
version "0.0.15"
resolved "https://registry.yarnpkg.com/next-themes/-/next-themes-0.0.15.tgz#ab0cee69cd763b77d41211f631e108beab39bf7d"