| 1 | import { |
| 2 | allEnglishWritings, |
| 3 | allGermanWritings, |
| 4 | } from "@/.content-collections/generated"; |
| 5 | import { Metadata } |
| 6 | import { notFound } |
| 7 | import { MDXContent } |
| 8 | import defaultComponents from "fumadocs-ui/mdx |
| 9 | import { Pre, CodeBlock |
| 10 | import dayjs from "dayjs |
| 11 | |
| 12 | export async function generateStaticParams |
| 13 | return [...allEnglishWritings |
| 14 | slug: writing._meta |
| 15 | locale: writing.locale |
| 16 | })); |
| 17 | } |
| 18 | export async function generateMetadata |
| 19 | params: Promise |
| 20 | }): Promise<Metadata |
| 21 | const params = |
| 22 | const post = |
| 23 | (post) => |
| 24 | ); |
| 25 | if (!post) |
| 26 | return { |
| 27 | title: post.title |
| 28 | description: post.summary |
| 29 | openGraph: { |
| 30 | title: post.title |
| 31 | description: post.summary |
| 32 | }, |
| 33 | }; |
| 34 | } |
| 35 | |
| 36 | export default async function |
| 37 | params: Promise |
| 38 | }) { |
| 39 | const params = |
| 40 | const post = |
| 41 | (post) => |
| 42 | ); |
| 43 | if (!post) |
| 44 | return ( |
| 45 | <article className="min-h-screen container items-center justify-center flex-col |
| 46 | <div className="flex flex-col max-w-[600px] mx-auto p-0 |
| 47 | <div className="container prose prose-invert prose-lg my-5 |
| 48 | <h1 className="text-xl font-bold mb-1 |
| 49 | <p className="text-sm text-gray-500 m-0 |
| 50 | <p className="text-base text-gray-400 mb-10 |
| 51 | <MDXContent |
| 52 | code={post.mdx |
| 53 | components={{ |
| 54 | ...defaultComponents, |
| 55 | pre: ({ ref |
| 56 | <CodeBlock {...props |
| 57 | <Pre>{props. |
| 58 | </CodeBlock> |
| 59 | ), |
| 60 | }} |
| 61 | /> |
| 62 | </div> |
| 63 | </div> |
| 64 | </article> |
| 65 | ); |
| 66 | } |