mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-16 21:30:39 -07:00
- Updated `.gitignore` to include new build and generated content directories. - Removed outdated Mintlify configuration files and documentation. - Introduced new `MIGRATION.md` to outline the transition from Mintlify to Fumadocs. - Added `mdx-components.tsx` for MDX component configuration and compatibility. - Updated `package.json` and `next.config.mjs` for new dependencies and Next.js configuration. - Created `source.config.ts` for content source configuration. - Added OpenAPI specification in `openapi.json` for API documentation. - Removed legacy files and adjusted project structure to align with Fumadocs conventions.
37 lines
822 B
TypeScript
37 lines
822 B
TypeScript
import { getPageImage, source } from '@/lib/source';
|
|
import { notFound } from 'next/navigation';
|
|
import { ImageResponse } from 'next/og';
|
|
import { generate as DefaultImage } from 'fumadocs-ui/og';
|
|
|
|
export const revalidate = false;
|
|
|
|
export async function GET(
|
|
_req: Request,
|
|
{ params }: RouteContext<'/og/docs/[...slug]'>,
|
|
) {
|
|
const { slug } = await params;
|
|
const page = source.getPage(slug.slice(0, -1));
|
|
if (!page) notFound();
|
|
|
|
return new ImageResponse(
|
|
(
|
|
<DefaultImage
|
|
title={page.data.title}
|
|
description={page.data.description}
|
|
site="My App"
|
|
/>
|
|
),
|
|
{
|
|
width: 1200,
|
|
height: 630,
|
|
},
|
|
);
|
|
}
|
|
|
|
export function generateStaticParams() {
|
|
return source.getPages().map((page) => ({
|
|
lang: page.locale,
|
|
slug: getPageImage(page).segments,
|
|
}));
|
|
}
|