version docs pages

This commit is contained in:
outfoxxed 2025-07-22 01:08:30 -07:00
parent 5865251560
commit 010557ea77
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
30 changed files with 324 additions and 340 deletions

View file

@ -0,0 +1,27 @@
---
import GuideLayout from "@layouts/GuideLayout.astro";
import { getVersionsData } from "@config/io/generateTypeData";
import { processMarkdown } from "@config/io/markdown";
import { getCollection, render } from "astro:content";
export async function getStaticPaths() {
const { versions } = await getVersionsData();
const guidePages = await getCollection("guide");
// versioned guides unhandled for now
return versions.flatMap(version => guidePages.map(page => ({
params: { version: version.name, id: page.id == "index" ? "/" : page.id },
props: { version, page },
})));
}
const { version, page } = Astro.props;
const { headings } = await render(page);
// we can't use 'Content' because there isn't a way to pass in a version
const html = await processMarkdown(version.name, page.body!);
---
<GuideLayout title={page.data.title} description="" headings={headings}>
<Fragment set:html={html}/>
</GuideLayout>