Skip to content

Commit 0dd05f5

Browse files
committed
Add sitemap and link it from robots.txt.
1 parent 5a211cd commit 0dd05f5

4 files changed

Lines changed: 30 additions & 17 deletions

File tree

site/package-lock.json

Lines changed: 10 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
},
1717
"devDependencies": {
1818
"@vitejs/plugin-vue": "^6.0.5",
19-
"vite": "^8.0.0"
19+
"vite": "^8.0.0",
20+
"vite-plugin-sitemap": "^0.8.2"
2021
}
2122
}

site/public/robots.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,6 @@ Disallow: /
4646

4747
User-agent: meta-externalagent
4848
Disallow: /
49+
50+
# --- Sitemap ---
51+
Sitemap: https://openpois.org/sitemap.xml

site/vite.config.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
import { defineConfig } from 'vite'
22
import vue from '@vitejs/plugin-vue'
3+
import sitemap from 'vite-plugin-sitemap'
34

45
export default defineConfig({
56
base: '/',
6-
plugins: [vue()],
7+
plugins: [
8+
vue(),
9+
sitemap({
10+
hostname: 'https://openpois.org',
11+
// index.html, about.html and taxonomy.html are globbed automatically from
12+
// the build output. Only /docs/ (the Sphinx site) must be listed here: it
13+
// is copied into dist/docs AFTER `vite build` by the deploy workflow, so
14+
// the plugin's glob can't see it at sitemap-generation time.
15+
dynamicRoutes: ['/docs/'],
16+
// Keep the hand-written public/robots.txt (content signals + AI opt-out).
17+
// The plugin would otherwise overwrite it with a generated stub.
18+
generateRobotsTxt: false,
19+
}),
20+
],
721
build: {
822
rollupOptions: {
923
output: {

0 commit comments

Comments
 (0)