docs: point readers (and their LLMs) at the markdown renditions (#2427)

This commit is contained in:
Felix Weinberger 2026-07-02 21:34:20 +01:00 • committed by GitHub
commit ddba550fa9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -53,6 +53,17 @@ export default defineConfig({
buildEnd(siteConfig) {
generateLlmsArtifacts(docsDir, siteConfig.outDir, siteUrl);
},
transformPageData(pageData) {
// Every guide page has a markdown rendition next to its HTML (llms.ts);
// advertise it to tools via a rel=alternate link. The API reference has none.
if (!pageData.relativePath.startsWith('api/')) {
pageData.frontmatter.head ??= [];
pageData.frontmatter.head.push([
'link',
{ rel: 'alternate', type: 'text/markdown', href: `${siteUrl}/${pageData.relativePath}` }
]);
}
},
themeConfig: {
nav: [
{ text: 'Get started', link: '/get-started/first-server', activeMatch: '^/get-started/' },