feat(sitemap): implement dynamic sitemap index and entity sitemaps

Convert sitemap.xml to a sitemap index referencing split modules
Add dynamic sitemaps for pokedex, habitats, collections, life, and threads
Fetch entity data from API to populate lastmod and priority
This commit is contained in:
2026-05-07 13:55:25 +08:00
parent 4a7309027a
commit 9db8e60f3d
9 changed files with 277 additions and 28 deletions

View File

@@ -0,0 +1,7 @@
import { normalizeApiBaseUrl, normalizeSiteUrl, threadsSitemapXml } from '../utils/seo-files';
export default defineEventHandler(async (event) => {
const config = useRuntimeConfig(event);
setHeader(event, 'Content-Type', 'application/xml; charset=utf-8');
return threadsSitemapXml(normalizeSiteUrl(config.public.siteUrl), normalizeApiBaseUrl(config.serverApiBaseUrl));
});