feat: write the site for Starlight behind a flag

generate_site.py --engine starlight writes the pages, navigation and
data files of an Astro Starlight project in website/. Links resolve to
site addresses, every heading keeps its MkDocs id, and pages split by
size are measured in the MkDocs Markdown so both builds cut the same
files. The 839 pages and their 45,613 ids match the MkDocs build.
This commit is contained in:
Abdessamad Derraz committed 2026-10-22 15:41:39 +02:00
1 parent d2974660eb
commit 342d0f7271
26 files changed
+7817 -60

No files matched your search

@@ -0,0 +1,21 @@
---
// Search ranking: Pagefind multiplies the score of words inside a weighted
// element, so a Start here page outranks the reference page that names it.
import Default from '@astrojs/starlight/components/MarkdownContent.astro';
const { boost } = Astro.locals.starlightRoute.entry.data;
---
{
boost ? (
<div data-pagefind-weight={String(Math.min(10, boost * 2))}>
<Default><slot /></Default>
</div>
) : (
<Default><slot /></Default>
)
}
<script>
import '../scripts/site.ts';
</script>