summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2025-06-17 13:37:41 +0200
committerYuval Adam <_@yuv.al>2025-06-17 13:37:41 +0200
commit6e8655a416e75f6a0f8e01a7dd800d9a43d1daf9 (patch)
treeadf9cc1bcfba70eed16419696cf8fbb1123b51fe
parentbe7b305bf60e082de6c5513eaac30d287e138bf1 (diff)
Add sitemap
-rw-r--r--astro.config.mjs6
-rw-r--r--package-lock.json64
-rw-r--r--package.json1
-rw-r--r--public/robots.txt4
-rw-r--r--src/layouts/Layout.astro1
5 files changed, 74 insertions, 2 deletions
diff --git a/astro.config.mjs b/astro.config.mjs
index a0f8daa..aea7ec0 100644
--- a/astro.config.mjs
+++ b/astro.config.mjs
@@ -5,13 +5,15 @@ import tailwindcss from '@tailwindcss/vite';
import react from '@astrojs/react';
+import sitemap from '@astrojs/sitemap';
+
// https://astro.build/config
export default defineConfig({
+ site: 'https://cidr.xyz',
vite: {
plugins: [tailwindcss()]
},
-
- integrations: [react()],
+ integrations: [react(), sitemap()],
devToolbar: {
enabled: false
}
diff --git a/package-lock.json b/package-lock.json
index 66398f3..a5c54b3 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,6 +9,7 @@
"version": "3.0.0",
"dependencies": {
"@astrojs/react": "^4.2.7",
+ "@astrojs/sitemap": "^3.4.1",
"@tailwindcss/vite": "^4.1.5",
"@types/netmask": "^2.0.5",
"@types/react": "^19.1.3",
@@ -109,6 +110,17 @@
"react-dom": "^17.0.2 || ^18.0.0 || ^19.0.0"
}
},
+ "node_modules/@astrojs/sitemap": {
+ "version": "3.4.1",
+ "resolved": "https://registry.npmjs.org/@astrojs/sitemap/-/sitemap-3.4.1.tgz",
+ "integrity": "sha512-VjZvr1e4FH6NHyyHXOiQgLiw94LnCVY4v06wN/D0gZKchTMkg71GrAHJz81/huafcmavtLkIv26HnpfDq6/h/Q==",
+ "license": "MIT",
+ "dependencies": {
+ "sitemap": "^8.0.0",
+ "stream-replace-string": "^2.0.0",
+ "zod": "^3.24.2"
+ }
+ },
"node_modules/@astrojs/telemetry": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/@astrojs/telemetry/-/telemetry-3.2.1.tgz",
@@ -2002,6 +2014,15 @@
"@types/react": "^19.0.0"
}
},
+ "node_modules/@types/sax": {
+ "version": "1.2.7",
+ "resolved": "https://registry.npmjs.org/@types/sax/-/sax-1.2.7.tgz",
+ "integrity": "sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
"node_modules/@types/unist": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz",
@@ -2144,6 +2165,12 @@
"url": "https://github.com/sponsors/jonschlinkert"
}
},
+ "node_modules/arg": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz",
+ "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==",
+ "license": "MIT"
+ },
"node_modules/argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
@@ -5195,6 +5222,12 @@
"fsevents": "~2.3.2"
}
},
+ "node_modules/sax": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz",
+ "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==",
+ "license": "ISC"
+ },
"node_modules/scheduler": {
"version": "0.26.0",
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz",
@@ -5295,6 +5328,31 @@
"integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==",
"license": "MIT"
},
+ "node_modules/sitemap": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/sitemap/-/sitemap-8.0.0.tgz",
+ "integrity": "sha512-+AbdxhM9kJsHtruUF39bwS/B0Fytw6Fr1o4ZAIAEqA6cke2xcoO2GleBw9Zw7nRzILVEgz7zBM5GiTJjie1G9A==",
+ "license": "MIT",
+ "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": ">=14.0.0",
+ "npm": ">=6.0.0"
+ }
+ },
+ "node_modules/sitemap/node_modules/@types/node": {
+ "version": "17.0.45",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz",
+ "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==",
+ "license": "MIT"
+ },
"node_modules/smol-toml": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.3.4.tgz",
@@ -5326,6 +5384,12 @@
"url": "https://github.com/sponsors/wooorm"
}
},
+ "node_modules/stream-replace-string": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/stream-replace-string/-/stream-replace-string-2.0.0.tgz",
+ "integrity": "sha512-TlnjJ1C0QrmxRNrON00JvaFFlNh5TTG00APw23j74ET7gkQpTASi6/L2fuiav8pzK715HXtUeClpBTw2NPSn6w==",
+ "license": "MIT"
+ },
"node_modules/string-width": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",
diff --git a/package.json b/package.json
index 47be3c8..29d6073 100644
--- a/package.json
+++ b/package.json
@@ -11,6 +11,7 @@
},
"dependencies": {
"@astrojs/react": "^4.2.7",
+ "@astrojs/sitemap": "^3.4.1",
"@tailwindcss/vite": "^4.1.5",
"@types/netmask": "^2.0.5",
"@types/react": "^19.1.3",
diff --git a/public/robots.txt b/public/robots.txt
new file mode 100644
index 0000000..4a7056d
--- /dev/null
+++ b/public/robots.txt
@@ -0,0 +1,4 @@
+User-agent: *
+Allow: /
+
+Sitemap: https://cidr.xyz/sitemap-index.xml \ No newline at end of file
diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro
index 0c6ecd7..c62a114 100644
--- a/src/layouts/Layout.astro
+++ b/src/layouts/Layout.astro
@@ -44,6 +44,7 @@ const {
<link rel="manifest" href="/manifest.json" />
<meta name="theme-color" content="#0066cc" />
<meta name="viewport" content="width=device-width" />
+ <link rel="sitemap" href="/sitemap-index.xml" />
<title>{title}</title>
{description && <meta name="description" content={description} />}