mirror of
https://github.com/jimeh/commonflow.org.git
synced 2026-02-19 05:46:40 +00:00
- 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
22 lines
572 B
Plaintext
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>
|