Skip to content

generate a sitemap on build #526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# added by mike - don't save public/rss.xml, which is generated only in production
# and will be made dynamically on server at build time
# added by mike - don't save rss.xml or sitemap.xml in the public folder.
# they are generated only in production, and will be made dynamically on server at build time
public/rss.xml
public/sitemap.xml

.next

Expand Down
5 changes: 5 additions & 0 deletions next-sitemap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
siteUrl: process.env.SITE_URL || 'https://mikebifulco.com',
generateRobotsTxt: true,
// ...other options
};
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"license": "MIT",
"scripts": {
"analyze": "ANALYZE=true next build",
"build": "next build",
"build": "next build && next-sitemap",
"postbuild": "next-sitemap",
"dev": "NODE_OPTIONS='--inspect' next dev",
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"",
"start": "next start",
Expand Down Expand Up @@ -53,6 +54,7 @@
"husky": ">=7.0.4",
"lint-staged": "^11.2.3",
"netlify-plugin-cache-nextjs": "^1.6.1",
"next-sitemap": "^1.6.192",
"prettier": "^2.4.1"
},
"repository": {
Expand Down
3 changes: 0 additions & 3 deletions public/robots.txt

This file was deleted.

21 changes: 21 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,11 @@
dependencies:
"@chakra-ui/utils" "1.8.3"

"@corex/deepmerge@^2.6.34":
version "2.6.34"
resolved "https://registry.yarnpkg.com/@corex/deepmerge/-/deepmerge-2.6.34.tgz#8dd084f2bcc9cf54f6b1210a1aebd25206de2a84"
integrity sha512-5l3bQRGOoCJ1nYTxEaOW/MRuwNDq32KYatWO5rwOlOzxY4beVCrxDBaDBX5wpDn0PYm0QAul/vAC9GDHShEbTw==

"@ctrl/tinycolor@^3.4.0":
version "3.4.0"
resolved "https://registry.yarnpkg.com/@ctrl/tinycolor/-/tinycolor-3.4.0.tgz#c3c5ae543c897caa9c2a68630bed355be5f9990f"
Expand Down Expand Up @@ -5017,6 +5022,13 @@ markdown-escapes@^1.0.0:
resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.4.tgz#c95415ef451499d7602b91095f3c8e8975f78535"
integrity sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg==

matcher@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/matcher/-/matcher-4.0.0.tgz#a42a05a09aaed92e2d241eb91fddac689461ea51"
integrity sha512-S6x5wmcDmsDRRU/c2dkccDwQPXoFczc5+HpQ2lON8pnvHlnvHAHj5WlLVvw6n6vNyHuVugYrFohYxbS+pvFpKQ==
dependencies:
escape-string-regexp "^4.0.0"

md5.js@^1.3.4:
version "1.3.5"
resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f"
Expand Down Expand Up @@ -5516,6 +5528,15 @@ next-mdx-remote@^3.0.6:
esbuild "^0.13.4"
pkg-dir "^5.0.0"

next-sitemap@^1.6.192:
version "1.6.192"
resolved "https://registry.yarnpkg.com/next-sitemap/-/next-sitemap-1.6.192.tgz#2f5c4e4b8ac12e2edcf8d2caffdd3b320b2b47a8"
integrity sha512-Pvxi5ttn/pedojrCvhGrvXsXg0bSV/scWCLrivO1xeBd+OVGiFyn60WHfx7I0HfW7nFQmbvwGfYffkUMOj/ptg==
dependencies:
"@corex/deepmerge" "^2.6.34"
matcher "^4.0.0"
minimist "^1.2.5"

next@^11.1.2:
version "11.1.2"
resolved "https://registry.yarnpkg.com/next/-/next-11.1.2.tgz#527475787a9a362f1bc916962b0c0655cc05bc91"
Expand Down