diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index 91c22474..6be0817f 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -1,17 +1,25 @@ import { defineConfig } from "astro/config"; import preact from "@astrojs/preact"; import react from "@astrojs/react"; - import mdx from "@astrojs/mdx"; +import sitemap from "@astrojs/sitemap"; + +const site = `https://nh.outerwildsmods.com`; + // https://astro.build/config export default defineConfig({ + compressHTML: true, integrations: [ // Enable Preact to support Preact JSX components. preact(), // Enable React for the Algolia search component. react(), - mdx() + mdx(), + sitemap({ + filter: (page) => + page !== `${site}/404.html` && page !== `${site}/reference/audio-enum/` + }) ], - site: `https://nh.outerwildsmods.com` + site }); diff --git a/docs/package.json b/docs/package.json index cfc46e2d..a4f12d6b 100644 --- a/docs/package.json +++ b/docs/package.json @@ -16,6 +16,7 @@ "@astrojs/mdx": "^0.19.7", "@astrojs/preact": "^2.2.1", "@astrojs/react": "^2.2.1", + "@astrojs/sitemap": "^1.3.3", "@docsearch/css": "^3.3.4", "@docsearch/react": "^3.3.4", "@types/node": "^18.16.3", diff --git a/docs/pnpm-lock.yaml b/docs/pnpm-lock.yaml index 2b4fb3b5..5dd7e191 100644 --- a/docs/pnpm-lock.yaml +++ b/docs/pnpm-lock.yaml @@ -20,6 +20,9 @@ dependencies: "@astrojs/react": specifier: ^2.2.1 version: 2.2.1(@types/react-dom@18.2.3)(@types/react@18.2.5)(react-dom@18.2.0)(react@18.2.0) + "@astrojs/sitemap": + specifier: ^1.3.3 + version: 1.3.3 "@docsearch/css": specifier: ^3.3.4 version: 3.3.4 @@ -448,6 +451,16 @@ packages: - supports-color dev: false + /@astrojs/sitemap@1.3.3: + resolution: + { + integrity: sha512-TPyyb/hKxc+bHPpSoNPhsuI0QOTVzq2tueg2r0CTH1HqigYIAA2LQkCBlQzz85R+LrOZpv4kXYmhxdDcSkJCmA== + } + dependencies: + sitemap: 7.1.1 + zod: 3.21.4 + dev: false + /@astrojs/telemetry@2.1.1: resolution: { @@ -1476,6 +1489,13 @@ packages: "@types/unist": 2.0.6 dev: false + /@types/node@17.0.45: + resolution: + { + integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw== + } + dev: false + /@types/node@18.16.3: resolution: { @@ -1524,6 +1544,15 @@ packages: } dev: false + /@types/sax@1.2.4: + resolution: + { + integrity: sha512-pSAff4IAxJjfAXUG6tFkO7dsSbTmf8CtUpfhhZ5VhkRpC4628tJhh3+V6H1E+/Gs9piSzYKT5yzHO5M4GG9jkw== + } + dependencies: + "@types/node": 18.16.3 + dev: false + /@types/scheduler@0.16.3: resolution: { @@ -1819,6 +1848,13 @@ packages: picomatch: 2.3.1 dev: false + /arg@5.0.2: + resolution: + { + integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg== + } + dev: false + /argparse@1.0.10: resolution: { @@ -5557,6 +5593,20 @@ packages: } dev: false + /sitemap@7.1.1: + resolution: + { + integrity: sha512-mK3aFtjz4VdJN0igpIJrinf3EO8U8mxOPsTBzSsy06UtjZQJ3YY3o3Xa7zSc5nMqcMrRwlChHZ18Kxg0caiPBg== + } + engines: { node: ">=12.0.0", npm: ">=5.6.0" } + hasBin: true + dependencies: + "@types/node": 17.0.45 + "@types/sax": 1.2.4 + arg: 5.0.2 + sax: 1.2.4 + dev: false + /slash@3.0.0: resolution: { diff --git a/docs/public/robots.txt b/docs/public/robots.txt new file mode 100644 index 00000000..dfa3fb4d --- /dev/null +++ b/docs/public/robots.txt @@ -0,0 +1,5 @@ +User-agent: * +Disallow: /audio-enum/ +Disallow: /404.html + +Sitemap: https://nh.outerwildsmods.com/sitemap-index.xml