wip: simplify and add favicon

This commit is contained in:
2026-01-11 00:36:23 +00:00
parent 8c91e2028a
commit da9171686d
17 changed files with 103 additions and 99 deletions

View File

@@ -0,0 +1,56 @@
---
import type { CollectionEntry } from "astro:content";
import * as fs from "node:fs";
import * as path from "node:path";
import SinglePage from "../layouts/SinglePage.astro";
import Header from "./Header.astro";
import Hero from "./Hero.astro";
import AboutSection from "./AboutSection.astro";
import SpecSection from "./SpecSection.astro";
import FAQSection from "./FAQSection.astro";
import Footer from "./Footer.astro";
import { parseSpecContent } from "../utils/parseSpecContent";
interface Props {
spec: CollectionEntry<"spec">;
}
const { spec } = Astro.props;
const version = spec.data.version;
// Read the markdown file
const filePath = path.join(process.cwd(), "src/content/spec", `${version}.md`);
const content = fs.readFileSync(filePath, "utf-8");
// Remove frontmatter
const markdown = content.replace(/^---[\s\S]*?---\n/, "");
// Parse the content into sections (handles markdown -> HTML internally)
const parsed = await parseSpecContent(markdown, version);
---
<SinglePage title={spec.data.title} version={version}>
<Header version={version} />
<main>
<Hero version={version} svgPath={parsed.svgPath} />
<AboutSection
introduction={parsed.introduction}
summary={parsed.summary}
license={parsed.license}
/>
<SpecSection
terminology={parsed.terminology}
terminologyTitle={parsed.terminologyTitle}
specification={parsed.specification}
tocItems={parsed.tocItems}
/>
<FAQSection items={parsed.faq} />
</main>
<Footer />
</SinglePage>

View File

@@ -50,7 +50,9 @@ const defaultDescription =
/>
<!-- Favicon -->
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="icon" href="/favicon.ico" sizes="32x32" />
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<!-- Theme initialization - prevent flash -->
<script is:inline>

View File

@@ -1,16 +1,7 @@
---
import { getCollection } from "astro:content";
import * as fs from "node:fs";
import * as path from "node:path";
import SinglePage from "../layouts/SinglePage.astro";
import Header from "../components/Header.astro";
import Hero from "../components/Hero.astro";
import AboutSection from "../components/AboutSection.astro";
import SpecSection from "../components/SpecSection.astro";
import FAQSection from "../components/FAQSection.astro";
import Footer from "../components/Footer.astro";
import { parseSpecContent } from "../utils/parseSpecContent";
import SpecPage from "../components/SpecPage.astro";
import { config } from "../config";
// Render the current/latest version
@@ -21,39 +12,6 @@ const spec = specs.find((s) => s.data.version === version);
if (!spec) {
throw new Error(`Spec version ${version} not found`);
}
// Read the markdown file
const filePath = path.join(process.cwd(), "src/content/spec", `${version}.md`);
const content = fs.readFileSync(filePath, "utf-8");
// Remove frontmatter
const markdown = content.replace(/^---[\s\S]*?---\n/, "");
// Parse the content into sections (handles markdown -> HTML internally)
const parsed = await parseSpecContent(markdown, version);
---
<SinglePage title={spec.data.title} version={version}>
<Header version={version} />
<main>
<Hero version={version} svgPath={parsed.svgPath} />
<AboutSection
introduction={parsed.introduction}
summary={parsed.summary}
license={parsed.license}
/>
<SpecSection
terminology={parsed.terminology}
terminologyTitle={parsed.terminologyTitle}
specification={parsed.specification}
tocItems={parsed.tocItems}
/>
<FAQSection items={parsed.faq} />
</main>
<Footer />
</SinglePage>
<SpecPage spec={spec} />

View File

@@ -1,17 +1,7 @@
---
import { getCollection } from "astro:content";
import * as fs from "node:fs";
import * as path from "node:path";
import SinglePage from "../../layouts/SinglePage.astro";
import Header from "../../components/Header.astro";
import Hero from "../../components/Hero.astro";
import AboutSection from "../../components/AboutSection.astro";
import SpecSection from "../../components/SpecSection.astro";
import FAQSection from "../../components/FAQSection.astro";
import Footer from "../../components/Footer.astro";
import { parseSpecContent } from "../../utils/parseSpecContent";
import { config } from "../../config";
import SpecPage from "../../components/SpecPage.astro";
export async function getStaticPaths() {
const specs = await getCollection("spec");
@@ -22,40 +12,6 @@ export async function getStaticPaths() {
}
const { spec } = Astro.props;
const version = spec.data.version;
// Read the markdown file
const filePath = path.join(process.cwd(), "src/content/spec", `${version}.md`);
const content = fs.readFileSync(filePath, "utf-8");
// Remove frontmatter
const markdown = content.replace(/^---[\s\S]*?---\n/, "");
// Parse the content into sections (handles markdown -> HTML internally)
const parsed = await parseSpecContent(markdown, version);
---
<SinglePage title={spec.data.title} version={version}>
<Header version={version} />
<main>
<Hero version={version} svgPath={parsed.svgPath} />
<AboutSection
introduction={parsed.introduction}
summary={parsed.summary}
license={parsed.license}
/>
<SpecSection
terminology={parsed.terminology}
terminologyTitle={parsed.terminologyTitle}
specification={parsed.specification}
tocItems={parsed.tocItems}
/>
<FAQSection items={parsed.faq} />
</main>
<Footer />
</SinglePage>
<SpecPage spec={spec} />