mirror of
https://github.com/Dokploy/website.git
synced 2026-07-04 05:25:24 +02:00
- Standardized import statements across various components to use double quotes for consistency. - Updated component files to ensure proper formatting and adherence to coding standards. - Enhanced overall code readability by aligning code structure and improving comment clarity. - Made minor adjustments to ensure all components follow the same coding conventions, improving maintainability.
35 lines
764 B
TypeScript
35 lines
764 B
TypeScript
import { getPageImage, source } from "@/lib/source";
|
|
import { generate as DefaultImage } from "fumadocs-ui/og";
|
|
import { notFound } from "next/navigation";
|
|
import { ImageResponse } from "next/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,
|
|
}));
|
|
}
|