Skip to content

Commit e23c1d3

Browse files
authored
Merge pull request #218 from authzed/sitemap
Add sitemap generation
2 parents d60f8a5 + 63dd09a commit e23c1d3

File tree

6 files changed

+40
-19
lines changed

6 files changed

+40
-19
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@ build/*
33
node_modules/*
44
.vercel
55
.next
6+
7+
# Generated
8+
public/robots.txt
9+
public/sitemap-0.xml
10+
public/sitemap.xml

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
enable-pre-post-scripts=true

next-sitemap.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/** @type {import('next-sitemap').IConfig} */
2+
module.exports = {
3+
siteUrl: `https://authzed.com${process.env.BASE_DIR ?? ''}`,
4+
generateRobotsTxt: true,
5+
// ...other options
6+
};

package.json

+2
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
},
1011
"bugs": {
@@ -23,6 +24,7 @@
2324
"clsx": "^2.1.0",
2425
"js-yaml": "^4.1.0",
2526
"next": "^13.5.6",
27+
"next-sitemap": "^4.2.3",
2628
"nextra": "^2.13.3",
2729
"nextra-theme-docs": "^2.13.3",
2830
"react": "^18.2.0",

pnpm-lock.yaml

+25-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

theme.config.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const config: DocsThemeConfig = {
9090
defaultTitle: 'AuthZed Docs',
9191
titleTemplate: '%s – AuthZed Docs',
9292
description: desc,
93-
canonical: `https://authzed.com/docs${asPath}`, // NOTE: Update this if the base dir ever changes
93+
canonical: `https://authzed.com${process.env.BASE_DIR ?? ''}${asPath}`, // NOTE: Update this if the base dir ever changes
9494
openGraph: {
9595
title,
9696
description: desc,

0 commit comments

Comments
 (0)