Skip to content

Commit fd19780

Browse files
authored
Merge pull request #526 from mbifulco/feature/sitemap
generate a sitemap on build
2 parents ddd9100 + 9ad1ff0 commit fd19780

File tree

5 files changed

+32
-6
lines changed

5 files changed

+32
-6
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# added by mike - don't save public/rss.xml, which is generated only in production
2-
# and will be made dynamically on server at build time
1+
# added by mike - don't save rss.xml or sitemap.xml in the public folder.
2+
# they are generated only in production, and will be made dynamically on server at build time
33
public/rss.xml
4+
public/sitemap.xml
45

56
.next
67

next-sitemap.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
siteUrl: process.env.SITE_URL || 'https://mikebifulco.com',
3+
generateRobotsTxt: true,
4+
// ...other options
5+
};

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"license": "MIT",
77
"scripts": {
88
"analyze": "ANALYZE=true next build",
9-
"build": "next build",
9+
"build": "next build && next-sitemap",
10+
"postbuild": "next-sitemap",
1011
"dev": "NODE_OPTIONS='--inspect' next dev",
1112
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"",
1213
"start": "next start",
@@ -53,6 +54,7 @@
5354
"husky": ">=7.0.4",
5455
"lint-staged": "^11.2.3",
5556
"netlify-plugin-cache-nextjs": "^1.6.1",
57+
"next-sitemap": "^1.6.192",
5658
"prettier": "^2.4.1"
5759
},
5860
"repository": {

public/robots.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

yarn.lock

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,11 @@
867867
dependencies:
868868
"@chakra-ui/utils" "1.8.3"
869869

870+
"@corex/deepmerge@^2.6.34":
871+
version "2.6.34"
872+
resolved "https://registry.yarnpkg.com/@corex/deepmerge/-/deepmerge-2.6.34.tgz#8dd084f2bcc9cf54f6b1210a1aebd25206de2a84"
873+
integrity sha512-5l3bQRGOoCJ1nYTxEaOW/MRuwNDq32KYatWO5rwOlOzxY4beVCrxDBaDBX5wpDn0PYm0QAul/vAC9GDHShEbTw==
874+
870875
"@ctrl/tinycolor@^3.4.0":
871876
version "3.4.0"
872877
resolved "https://registry.yarnpkg.com/@ctrl/tinycolor/-/tinycolor-3.4.0.tgz#c3c5ae543c897caa9c2a68630bed355be5f9990f"
@@ -5017,6 +5022,13 @@ markdown-escapes@^1.0.0:
50175022
resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.4.tgz#c95415ef451499d7602b91095f3c8e8975f78535"
50185023
integrity sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg==
50195024

5025+
matcher@^4.0.0:
5026+
version "4.0.0"
5027+
resolved "https://registry.yarnpkg.com/matcher/-/matcher-4.0.0.tgz#a42a05a09aaed92e2d241eb91fddac689461ea51"
5028+
integrity sha512-S6x5wmcDmsDRRU/c2dkccDwQPXoFczc5+HpQ2lON8pnvHlnvHAHj5WlLVvw6n6vNyHuVugYrFohYxbS+pvFpKQ==
5029+
dependencies:
5030+
escape-string-regexp "^4.0.0"
5031+
50205032
md5.js@^1.3.4:
50215033
version "1.3.5"
50225034
resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f"
@@ -5516,6 +5528,15 @@ next-mdx-remote@^3.0.6:
55165528
esbuild "^0.13.4"
55175529
pkg-dir "^5.0.0"
55185530

5531+
next-sitemap@^1.6.192:
5532+
version "1.6.192"
5533+
resolved "https://registry.yarnpkg.com/next-sitemap/-/next-sitemap-1.6.192.tgz#2f5c4e4b8ac12e2edcf8d2caffdd3b320b2b47a8"
5534+
integrity sha512-Pvxi5ttn/pedojrCvhGrvXsXg0bSV/scWCLrivO1xeBd+OVGiFyn60WHfx7I0HfW7nFQmbvwGfYffkUMOj/ptg==
5535+
dependencies:
5536+
"@corex/deepmerge" "^2.6.34"
5537+
matcher "^4.0.0"
5538+
minimist "^1.2.5"
5539+
55195540
next@^11.1.2:
55205541
version "11.1.2"
55215542
resolved "https://registry.yarnpkg.com/next/-/next-11.1.2.tgz#527475787a9a362f1bc916962b0c0655cc05bc91"

0 commit comments

Comments
 (0)