mirror of
https://github.com/fosrl/docs-v2.git
synced 2026-09-27 08:19:08 +02:00
port mintlify to fumadocs
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { source } from '@/lib/source';
|
||||
import { notFound } from 'next/navigation';
|
||||
import { generateOGImage } from 'fumadocs-ui/og';
|
||||
import { appName, getPageImageUrl } from '@/lib/shared';
|
||||
|
||||
export const revalidate = false;
|
||||
|
||||
export async function GET(_req: Request, { params }: RouteContext<'/og/[...slug]'>) {
|
||||
const { slug } = await params;
|
||||
const page = source.getPage(slug.slice(0, -1));
|
||||
if (!page) notFound();
|
||||
|
||||
return generateOGImage({
|
||||
title: page.data.title,
|
||||
description: page.data.description,
|
||||
site: appName,
|
||||
primaryColor: 'rgba(243, 97, 23, 0.35)',
|
||||
primaryTextColor: 'rgb(243, 97, 23)',
|
||||
});
|
||||
}
|
||||
|
||||
export function generateStaticParams() {
|
||||
return source.getPages().map((page) => ({
|
||||
slug: getPageImageUrl(page).segments,
|
||||
}));
|
||||
}
|
||||
Reference in New Issue
Block a user