perf: optimize docs static generation cost (#12108)

## Summary
- Switch the docs catch-all route to full static generation and prebuild
both latest and versioned docs paths.
- Prebuild OG images for all docs pages, make sitemap and LLM export
static, and remove nondeterministic sitemap timestamps.
- Reduce build-time overhead by memoizing docs sidebar trees and
skipping processed markdown generation for versioned docs.

## Testing
- `pnpm nx run @zitadel/docs:build`
- `pnpm nx run @zitadel/docs:lint`
- `pnpm nx run @zitadel/docs:check-types`
- Verified the prerender manifest contains 8,816 prerendered routes,
3,293 versioned docs routes, 4,406 OG routes, and zero revalidating docs
routes.
This commit is contained in:
Florian Forster
2026-04-27 15:34:00 +00:00
committed by GitHub
parent f96a9c54ac
commit 24d0f34f39
6 changed files with 94 additions and 89 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import { getPageImage, getPage, source } from '@/lib/source';
import { generateAllDocParams, getPageImage, getPage, source } from '@/lib/source';
import {
DocsBody,
DocsPage,
@@ -43,7 +43,7 @@ export const revalidate = false;
export const dynamic = 'force-static';
export async function generateStaticParams() {
return source.generateParams();
return generateAllDocParams();
}
export async function generateMetadata(