feat(seo): site config, sitemap, robots.txt, llms.txt and a real 404 page
- astro.config: site, trailingSlash "never", build.format "file". - /sitemap-index.xml + /sitemap-0.xml as prerendered endpoints (no new dependency); pages are derived from src/pages/*.astro, 404 excluded. - robots.txt: all bots allowed, AI crawlers/training bots explicitly allowed (Linus's decision), /download/ disallowed, sitemap line. - /llms.txt generated from business.ts, incl. usage-with-attribution note. - 404.astro in Swedish with links back, noindex. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WvE3C43Uwtv2vtnoFBLDw7
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
30e385ec7f
commit
f452d6d237
@@ -0,0 +1,12 @@
|
||||
// src/lib/pages.ts
|
||||
// Sajtens riktiga sidor, härledda från src/pages/*.astro (404 och _-filer exkluderas).
|
||||
// Nya sidor hamnar automatiskt i sitemap.
|
||||
const pageFiles = import.meta.glob('../pages/*.astro');
|
||||
|
||||
export function sitePaths(): string[] {
|
||||
return Object.keys(pageFiles)
|
||||
.map((file) => file.replace(/^\.\.\/pages\//, '').replace(/\.astro$/, ''))
|
||||
.filter((name) => name !== '404' && !name.startsWith('_') && !name.startsWith('['))
|
||||
.map((name) => (name === 'index' ? '/' : `/${name}`))
|
||||
.sort((a, b) => (a === '/' ? -1 : b === '/' ? 1 : a.localeCompare(b)));
|
||||
}
|
||||
Reference in New Issue
Block a user