seo: implement OpenAPI operation rendering and add llms documentation

This commit is contained in:
Dries Augustyns
2026-05-13 17:37:02 +02:00
parent 463301b5db
commit 4e95c5a4e4
11 changed files with 500 additions and 2 deletions
+5
View File
@@ -1,6 +1,8 @@
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
import { hasMarkdownVariant } from './content/markdown-slugs';
type Negotiated = 'markdown' | 'html' | 'none';
function parseAccept(accept: string): Array<{ type: string; q: number }> {
@@ -59,6 +61,9 @@ export function middleware(request: NextRequest) {
const response = NextResponse.next();
response.headers.set('Vary', 'Accept');
if (hasMarkdownVariant(pathname)) {
response.headers.append('Link', `<${pathname}.md>; rel="alternate"; type="text/markdown"`);
}
return response;
}