Features hinzufügen
Sitemap hinzufügen
Abschnitt betitelt „Sitemap hinzufügen“Installation
Abschnitt betitelt „Installation“npx astro add sitemapoder
npm install @astrojs/sitemapKonfiguration astro.config.mjs
Abschnitt betitelt „Konfiguration astro.config.mjs“ export default defineConfig({ site: 'https://code.sven-pietsch.de', integrations: [starlight({ title: 'Svens Codebase', customCss: [ './src/styles/custom.css', ], locales: { ... } ... components: { Footer: './src/components/Footer.astro', }, }), mdx(), sitemap()], });Verlinkungen
Abschnitt betitelt „Verlinkungen“Sitemap link in <head>
Abschnitt betitelt „Sitemap link in <head>“Hinweis Nur, wenn ein eigenes Header-Template genutzt wird.
<head> <link rel="sitemap" href="/sitemap-index.xml" /></head>Sitemap link in robots.txt
Abschnitt betitelt „Sitemap link in robots.txt“User-agent: *Allow: /
Sitemap: https://<YOUR SITE>/sitemap-index.xml