Files
commonflow.org/src/pages/index.astro

18 lines
519 B
Plaintext

---
import { getCollection } from "astro:content";
import SpecLayout from "../layouts/SpecLayout.astro";
import { getVersionInfo } from "../utils/versions";
// Get version info and render the current/latest version
const { versions, currentVersion } = await getVersionInfo();
const specs = await getCollection("spec");
const spec = specs.find((s) => s.data.version === currentVersion);
if (!spec) {
throw new Error(`Spec version ${currentVersion} not found`);
}
---
<SpecLayout spec={spec} versions={versions} />