diff --git a/app/brand/page.tsx b/app/brand/page.tsx index 49ad3ec..71bc331 100644 --- a/app/brand/page.tsx +++ b/app/brand/page.tsx @@ -143,10 +143,10 @@ export default function BrandPage() {
Need a different format?{" "} - Contact us + Open a Issue {" "} for SVG or other formats.
diff --git a/app/docs-og/[...slug]/route.tsx b/app/docs-og/[...slug]/route.tsx index 0bec07b..ebe0f7f 100644 --- a/app/docs-og/[...slug]/route.tsx +++ b/app/docs-og/[...slug]/route.tsx @@ -1,16 +1,146 @@ import { metadataImage } from "@/lib/docs/metadata"; -import { generateOGImage } from "fumadocs-ui/og"; +import { ImageResponse } from "next/og"; +import React from "react"; +import fs from "node:fs"; +import path from "node:path"; export const dynamic = "force-dynamic"; -export const GET = metadataImage.createAPI((page) => { - return generateOGImage({ - title: page.data.title, - description: page.data.description, - site: "FixFX", - primaryColor: "#3b82f6", - primaryTextColor: "#f8fafc", - }); +export const GET = metadataImage.createAPI(async (page: any) => { + // Truncate description to prevent overflow + const maxDescLength = 150; + const description = page.data.description + ? page.data.description.length > maxDescLength + ? page.data.description.substring(0, maxDescLength).trim() + "..." + : page.data.description + : ""; + + // Read the logo from the filesystem + const logoPath = path.join(process.cwd(), "public", "logo.png"); + const logoBuffer = fs.readFileSync(logoPath); + const logoData = logoBuffer.buffer.slice(logoBuffer.byteOffset, logoBuffer.byteOffset + logoBuffer.byteLength); + + return new ImageResponse( + ( ++ {description} +
+ )} +- Trusted hosting providers for your{" "} - FiveM and{" "} - RedM{" "} - servers -
- - {/* Bottom indicators */} -+ Trusted hosting providers for your + FiveM + and + RedM + servers +
+ + {/* Bottom indicators */} +