@@ -3,15 +3,16 @@ import type { Metadata } from "next";
33import { globals } from "@/globals" ;
44import { notFound } from "next/navigation" ;
55
6- import MDX from "@/components/mdx" ;
76import { cn } from "@/utils/cn" ;
87import { getDocument } from "@/utils/docs" ;
98
10- import Article from "@/components/docs/doc-article " ;
9+ import MDX from "@/components/mdx " ;
1110import Container from "@/components/container" ;
11+ import Article from "@/components/docs/doc-article" ;
12+
13+ import DocOptions from "@/components/docs/doc-options" ;
1214import TableOfContents from "@/components/docs/toc-menu" ;
1315import ShowCategories from "@/components/docs/show-categories" ;
14- import DocOptions from "@/components/docs/doc-options" ;
1516
1617interface DocsPageProps {
1718 params : Promise < { folder : string ; slug : string [ ] } > ;
@@ -22,13 +23,29 @@ export async function generateMetadata({
2223} : DocsPageProps ) : Promise < Metadata > {
2324 const { folder, slug } = await params ;
2425 const document = slug . join ( "/" ) ;
26+ const websiteUrl = "https://code-blocks.pheralb.dev" ;
2527 const data = getDocument ( {
2628 folder,
2729 document,
2830 } ) ;
2931 return {
3032 title : `${ data ?. title } - ${ globals . title } ` ,
3133 description : data ?. description ,
34+ openGraph : {
35+ type : "website" ,
36+ url : new URL ( `/${ slug } ` , websiteUrl ) ,
37+ title : `${ data ?. title } - ${ globals . title } ` ,
38+ description : data ?. description ,
39+ siteName : websiteUrl ,
40+ images : [
41+ {
42+ url : new URL (
43+ `/api/docs/og?document=${ document } &folder=${ folder } ` ,
44+ websiteUrl ,
45+ ) ,
46+ } ,
47+ ] ,
48+ } ,
3249 } ;
3350}
3451
0 commit comments