seo: implement OpenAPI operation rendering and add llms documentation
This commit is contained in:
@@ -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}],
|
||||
},
|
||||
|
||||
@@ -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',
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user