Migrate documentation site to Astro

This commit is contained in:
2026-06-17 00:22:32 +09:00
parent 4020b7c2d5
commit 0e873fbd51
19 changed files with 5494 additions and 325 deletions
+6 -6
View File
@@ -79,18 +79,18 @@ export const nav = [
{ title: 'Open Issues', slug: 'open-issues' },
];
marked.setOptions({
gfm: true,
mangle: false,
headerIds: true,
});
marked.setOptions({ gfm: true });
export function allDocSlugs() {
return Object.keys(docs).filter((slug) => slug !== 'index');
}
export function renderMarkdown(slug) {
const source = docs[slug] ?? docs.index;
const html = marked.parse(source ?? '# Not found\n');
return html.replace(/href="([^"#][^"]*)\.md(#[^"]*)?"/g, (_all, href, hash = '') => {
const target = normalizeDocLink(slug, href);
return `href="#/docs/${target}${hash}"`;
return `href="/docs/${target}/${hash}"`;
});
}