feat(kb) - Add sitemap (#51132)

Adds a sitemap file to the new KB.

## Preview links

https://kb-git-kb-seo-conventions-supabase.vercel.app/kb/

## Review instructions

On the preview, check the following paths:

-
[`/sitemap-index.xml`](https://kb-git-kb-seo-conventions-supabase.vercel.app/kb/sitemap-index.xml)
and
[`/sitemap-0.xml`](https://kb-git-kb-seo-conventions-supabase.vercel.app/kb//sitemap-0.xml)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* A sitemap is now generated for the knowledge base and linked from its
pages. Its URL reflects the site’s configured base path, so the link
points to the correct location across different deployment paths.
Existing content and page functionality remain unchanged.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
This commit is contained in:
Kody JacksonandIvan Vasilov authored and GitHub committed 2026-10-02 09:40:24 -05:00
1 parent 4617b6f4cb
commit ce2f1da065
4 files changed
+443 -36

No files matched your search

+9 -9
View File
@@ -11,6 +11,8 @@ import { defineConfig } from 'astro/config'
import rehypeAdmonitions from './src/lib/mdx/rehype-admonitions.js'
import supabaseTheme from '../learn/lib/themes/supabase-2.json' with { type: 'json' }
import sitemap from '@astrojs/sitemap';
// Absolute dir of lodash-es, for the SSR-only lodash alias below (same fix
// apps/studio/vite.config.ts uses). `packages/ui`'s clipboard util does
// `import { noop } from 'lodash'` — under Vite's dev-mode SSR module runner,
@@ -41,18 +43,16 @@ const ssrLodashEs = {
// https://astro.build/config
export default defineConfig({
site: 'https://supabase.com',
base: '/kb',
trailingSlash: 'ignore',
integrations: [
react(),
// rehype-admonitions is a custom rehype plugin and Astro's default pipeline is
// satteri, so .mdx gets its own unified processor. Plain .md stays on satteri.
mdx({
processor: unified({
rehypePlugins: [rehypeAdmonitions],
}),
integrations: [react(), // rehype-admonitions is a custom rehype plugin and Astro's default pipeline is
// satteri, so .mdx gets its own unified processor. Plain .md stays on satteri.
mdx({
processor: unified({
rehypePlugins: [rehypeAdmonitions],
}),
],
}), sitemap()],
vite: {
ssr: {
noExternal: ['lodash'],
+2
View File
@@ -18,6 +18,7 @@
"@astrojs/markdown-remark": "7.2.4",
"@astrojs/mdx": "^7.0.7",
"@astrojs/react": "^6.0.4",
"@astrojs/sitemap": "^3.7.4",
"astro": "^7.2.6",
"lucide-react": "*",
"react": "catalog:",
@@ -34,6 +35,7 @@
},
"devDependencies": {
"@tailwindcss/vite": "4.2.4",
"@types/node": "catalog:",
"@types/react": "catalog:",
"@types/react-dom": "catalog:",
"config": "workspace:*",
+1
View File
@@ -59,6 +59,7 @@ const { title, description } = Astro.props
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap"
/>
<link rel="sitemap" href={`${import.meta.env.BASE_URL}/sitemap-index.xml`} />
<title>{title} | Supabase Knowledge Base</title>
</head>
<body>