Files
commonflow.org/src/pages/index.astro
Claude 868e67ad4b 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
2026-01-13 06:59:50 +00:00

22 lines
572 B
Plaintext

---
import { getCollection, render } from "astro:content";
import Default from "../layouts/Default.astro";
import { config } from "../config";
// 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>