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
@@ -64,6 +64,11 @@ export async function generateMetadata(props: {params: Promise<{slug?: string[]}
return {
title: page.data.title,
description: page.data.description,
alternates: {
types: {
'text/markdown': `${page.url}.md`,
},
},
openGraph: {
images: [{url: ogUrl.toString(), width: 1200, height: 630}],
},
+16
View File
@@ -0,0 +1,16 @@
import {openapi} from '@/lib/openapi';
export const revalidate = false;
export async function GET() {
const schemas = await openapi.getSchemas();
const first = Object.values(schemas)[0];
if (!first) return new Response('Not found', {status: 404});
return new Response(JSON.stringify(first.bundled), {
headers: {
'Content-Type': 'application/json; charset=utf-8',
'Cache-Control': 'public, max-age=300, s-maxage=3600',
},
});
}