Skip to content

Commit

Permalink
fix(sitemap): switch from dynamic generation to static generation
Browse files Browse the repository at this point in the history
issue #654
  • Loading branch information
sabertazimi committed Apr 25, 2022
1 parent 477707b commit 5b5f156
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 20 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,10 @@ out/
# IDE files
.vscode/*
!.vscode/settings.json

# sitemap files
sitemap.xml
sitemap-0.xml

# robots.txt
robots.txt
7 changes: 7 additions & 0 deletions next-sitemap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/** @type {import('next-sitemap').IConfig} */
const config = {
siteUrl: 'https://blog.tazimi.dev',
generateRobotsTxt: true,
};

module.exports = config;
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"browserslist": "last 2 versions",
"packageManager": "[email protected]",
"scripts": {
"build": "next build",
"build": "next build && next-sitemap",
"dev": "next",
"format": "prettier --write {__mocks__,components,config,contents,hooks,layouts,lib,pages,styles,types}/**/*.{ts,tsx,css}",
"lint": "next lint && yarn lint:md && yarn lint:style && yarn lint:type-check",
Expand Down Expand Up @@ -71,6 +71,7 @@
"jest": "^27.5.1",
"jest-axe": "^6.0.0",
"markdownlint-cli": "^0.31.1",
"next-sitemap": "^2.5.20",
"postcss": "^8.4.12",
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-preset-env": "^7.4.3",
Expand Down
19 changes: 0 additions & 19 deletions pages/sitemap.xml.ts

This file was deleted.

22 changes: 22 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,13 @@ __metadata:
languageName: node
linkType: hard

"@corex/deepmerge@npm:^2.6.148":
version: 2.6.148
resolution: "@corex/deepmerge@npm:2.6.148"
checksum: b80b6b3e408901151de26e27b519a43cda1771a81e5390ff10cd6b47add0139bb315ca44112ff076d68ac887d7cfe237c9fb33868efb04839c4afb7c38864385
languageName: node
linkType: hard

"@csstools/postcss-color-function@npm:^1.0.3":
version: 1.1.0
resolution: "@csstools/postcss-color-function@npm:1.1.0"
Expand Down Expand Up @@ -1194,6 +1201,7 @@ __metadata:
next: 12.1.5
next-progress: ^2.2.0
next-seo: ^5.4.0
next-sitemap: ^2.5.20
postcss: ^8.4.12
postcss-flexbugs-fixes: ^5.0.2
postcss-preset-env: ^7.4.3
Expand Down Expand Up @@ -6313,6 +6321,20 @@ __metadata:
languageName: node
linkType: hard

"next-sitemap@npm:^2.5.20":
version: 2.5.20
resolution: "next-sitemap@npm:2.5.20"
dependencies:
"@corex/deepmerge": ^2.6.148
minimist: ^1.2.6
peerDependencies:
next: "*"
bin:
next-sitemap: bin/next-sitemap
checksum: b2a770575117d709bf0c90ca6f6e76a6602980472480cbaa1f60104dae01428ce2491e4e06a19365014dec32629b19b8d627c40df0137ee126390aa8da42c30e
languageName: node
linkType: hard

"next@npm:12.1.5":
version: 12.1.5
resolution: "next@npm:12.1.5"
Expand Down

0 comments on commit 5b5f156

Please sign in to comment.