From e1366b75177d65a0e250c491787dd9d863884c0a Mon Sep 17 00:00:00 2001 From: cabralpinto Date: Tue, 29 Aug 2023 16:10:52 +0100 Subject: [PATCH] Docs: Add sitemap for SEO --- docs/astro.config.mjs | 3 ++- docs/package-lock.json | 46 +++++++++++++++++++++++++++++++++++ docs/package.json | 3 ++- docs/public/robots.txt | 4 +++ docs/src/layouts/Layout.astro | 1 + 5 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 docs/public/robots.txt diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index 836caec..488a4e6 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -1,4 +1,5 @@ import mdx from "@astrojs/mdx"; +import sitemap from "@astrojs/sitemap"; import tailwind from "@astrojs/tailwind"; import { defineConfig } from "astro/config"; import rehypeKatex from "rehype-katex"; @@ -7,7 +8,7 @@ import remarkLayout from "./src/plugins/remark-layout.mjs"; // https://astro.build/config export default defineConfig({ - integrations: [tailwind(), mdx()], + integrations: [tailwind(), mdx(), sitemap()], markdown: { remarkPlugins: [remarkMath, remarkLayout], rehypePlugins: [rehypeKatex], diff --git a/docs/package-lock.json b/docs/package-lock.json index 427186f..bf06b3d 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -8,6 +8,7 @@ "version": "0.0.1", "dependencies": { "@astrojs/mdx": "^0.19.7", + "@astrojs/sitemap": "^2.0.2", "@astrojs/tailwind": "^4.0.0", "@fontsource/roboto": "^5.0.8", "astro": "^2.10.1", @@ -149,6 +150,15 @@ "node": ">=16.12.0" } }, + "node_modules/@astrojs/sitemap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@astrojs/sitemap/-/sitemap-2.0.2.tgz", + "integrity": "sha512-dFWtdFwN8kxDiqIxF8T8ODqsUr6hG+EQlFEqm+3oQkhAkucF9QkYLM5Q72mEbYytkL4jvKyHbW1u10T5sWBZew==", + "dependencies": { + "sitemap": "^7.1.1", + "zod": "^3.17.3" + } + }, "node_modules/@astrojs/tailwind": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@astrojs/tailwind/-/tailwind-4.0.0.tgz", @@ -1152,6 +1162,11 @@ "@types/unist": "^2" } }, + "node_modules/@types/node": { + "version": "17.0.45", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", + "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==" + }, "node_modules/@types/parse5": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/@types/parse5/-/parse5-6.0.3.tgz", @@ -1162,6 +1177,14 @@ "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==" }, + "node_modules/@types/sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-pSAff4IAxJjfAXUG6tFkO7dsSbTmf8CtUpfhhZ5VhkRpC4628tJhh3+V6H1E+/Gs9piSzYKT5yzHO5M4GG9jkw==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/unist": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.7.tgz", @@ -5634,6 +5657,11 @@ "suf-log": "^2.5.3" } }, + "node_modules/sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + }, "node_modules/section-matter": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", @@ -5726,6 +5754,24 @@ "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" }, + "node_modules/sitemap": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/sitemap/-/sitemap-7.1.1.tgz", + "integrity": "sha512-mK3aFtjz4VdJN0igpIJrinf3EO8U8mxOPsTBzSsy06UtjZQJ3YY3o3Xa7zSc5nMqcMrRwlChHZ18Kxg0caiPBg==", + "dependencies": { + "@types/node": "^17.0.5", + "@types/sax": "^1.2.1", + "arg": "^5.0.0", + "sax": "^1.2.4" + }, + "bin": { + "sitemap": "dist/cli.js" + }, + "engines": { + "node": ">=12.0.0", + "npm": ">=5.6.0" + } + }, "node_modules/source-map": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", diff --git a/docs/package.json b/docs/package.json index 846a1fc..24a3f06 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,5 +1,5 @@ { - "name": "", + "name": "modular-diffusion-docs", "type": "module", "version": "0.0.1", "scripts": { @@ -11,6 +11,7 @@ }, "dependencies": { "@astrojs/mdx": "^0.19.7", + "@astrojs/sitemap": "^2.0.2", "@astrojs/tailwind": "^4.0.0", "@fontsource/roboto": "^5.0.8", "astro": "^2.10.1", diff --git a/docs/public/robots.txt b/docs/public/robots.txt new file mode 100644 index 0000000..01a1b63 --- /dev/null +++ b/docs/public/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Allow: / + +Sitemap: https://cabralpinto.github.io/sitemap-index.xml \ No newline at end of file diff --git a/docs/src/layouts/Layout.astro b/docs/src/layouts/Layout.astro index 6f89026..073778f 100644 --- a/docs/src/layouts/Layout.astro +++ b/docs/src/layouts/Layout.astro @@ -34,6 +34,7 @@ const { integrity="sha384-MlJdn/WNKDGXveldHDdyRP1R4CTHr3FeuDNfhsLPYrq2t0UBkUdK2jyTnXPEK1NQ" crossorigin="anonymous" /> +