mirror of
https://github.com/jimeh/commonflow.org.git
synced 2026-02-19 05:46:40 +00:00
feat: add llms.txt and rename raw spec URL to match filename
- Add /llms.txt endpoint following llmstxt.org specification format
- Change raw markdown URL from /spec/{version}/raw.md to
/spec/git-common-flow-v{version}.md to match download filename
- Add <link rel="alternate"> for raw markdown in spec pages
- Add Raw button to markdown view page
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -31,7 +31,11 @@ const markdown = content.replace(/^---[\s\S]*?---\n/, "");
|
||||
const parsed = await parseSpecContent(markdown);
|
||||
|
||||
// Read SVG content for inline embedding
|
||||
const svgFilePath = path.join(process.cwd(), "src/content/spec", `${version}.svg`);
|
||||
const svgFilePath = path.join(
|
||||
process.cwd(),
|
||||
"src/content/spec",
|
||||
`${version}.svg`
|
||||
);
|
||||
let svgContent: string | null = null;
|
||||
if (fs.existsSync(svgFilePath)) {
|
||||
svgContent = fs.readFileSync(svgFilePath, "utf-8");
|
||||
@@ -39,14 +43,19 @@ if (fs.existsSync(svgFilePath)) {
|
||||
---
|
||||
|
||||
<BaseLayout title={spec.data.title}>
|
||||
<Fragment slot="head">
|
||||
<link
|
||||
rel="alternate"
|
||||
type="text/markdown"
|
||||
href={`/spec/git-common-flow-v${version}.md`}
|
||||
title="Raw Markdown"
|
||||
/>
|
||||
</Fragment>
|
||||
|
||||
<Header version={version} versions={versions} />
|
||||
|
||||
<main>
|
||||
<Hero
|
||||
version={version}
|
||||
versions={versions}
|
||||
svgContent={svgContent}
|
||||
/>
|
||||
<Hero version={version} versions={versions} svgContent={svgContent} />
|
||||
|
||||
<AboutSection
|
||||
introduction={parsed.introduction}
|
||||
|
||||
Reference in New Issue
Block a user