refactor guide pages to use content collections

also configuration->guide
This commit is contained in:
outfoxxed 2025-05-13 20:56:31 -07:00
parent a449f976c7
commit b066a48976
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
13 changed files with 68 additions and 83 deletions

View file

@ -0,0 +1,30 @@
---
import DocsLayout from "@layouts/DocsLayout.astro";
import TOC from "@components/navigation/sidebars/TOC.astro";
import TOCIntersectionObserver from "@src/components/hooks/TOCIntersectionObserver.astro";
import { getCollection, render } from "astro:content";
export async function getStaticPaths() {
const guidePages = await getCollection("guide");
return guidePages.map(page => ({
params: { id: page.id == "index" ? "/" : page.id },
props: { page },
}));
}
const { page } = Astro.props;
const { Content, headings } = await render(page);
---
<DocsLayout title={page.data.title} description="" headings={headings}>
<div class="docs">
<div class="docs-content">
<hr>
<Content/>
</div>
<TOC mobile={false} headings={headings} data-pagefind-ignore/>
</div>
</DocsLayout>
<TOCIntersectionObserver/>