feat: render current spec on index page instead of redirecting

- Update index.astro to fetch and render the current spec version
  directly rather than redirecting to /spec/{version}
- Move .spec-content styles from [version].astro to global.css
  to share styles between index and version pages
- Rebuild site with new index page
This commit is contained in:
Claude
2026-01-12 20:12:27 +00:00
committed by Jim Myhrberg
parent 58f310bb8c
commit 868e67ad4b
12 changed files with 490 additions and 106 deletions

View File

@@ -1,6 +1,21 @@
---
import { getCollection, render } from "astro:content";
import Default from "../layouts/Default.astro";
import { config } from "../config";
// Redirect to current version
return Astro.redirect(`/spec/${config.currentVersion}`);
// Get all specs and find the current version
const specs = await getCollection("spec");
const currentSpec = specs.find((s) => s.data.version === config.currentVersion);
if (!currentSpec) {
return Astro.redirect("/404");
}
const { Content } = await render(currentSpec);
---
<Default title={currentSpec.data.title} version={currentSpec.data.version}>
<article class="spec-content">
<Content />
</article>
</Default>