import { getWikiPageBySlug } from '@/lib/wiki'; import { notFound } from 'next/navigation'; import { MDXRemote } from 'next-mdx-remote/rsc'; import rehypePrettyCode from 'rehype-pretty-code'; import rehypeSlug from 'rehype-slug'; import rehypeAutolinkHeadings from 'rehype-autolink-headings'; import { Callout, Grid, Card, Steps, Step, InlineCode, CodeBlockContainer } from '@/components/mdx-components'; const mdxOptions = { mdxOptions: { rehypePlugins: [ rehypeSlug, // creates heading-ids automaticly [ rehypeAutolinkHeadings, { behavior: 'prepend', // symbol is PRE header properties: { className: ['heading-anchor'], ariaHidden: 'true', tabIndex: -1, }, content: { type: 'text', value: ' #', // symbol }, }, ], [ rehypePrettyCode, { theme: 'github-dark', keepBackground: true, }, ], ], }, }; const mdxComponents = { // Eigene UI-Komponenten Callout, Grid, Card, Steps, Step, // Custom Typography Überschreibungen code: InlineCode, pre: CodeBlockContainer, h1: (props: any) =>

, h2: (props: any) =>

, h3: (props: any) =>

, }; type PageProps = { params: Promise<{ slug: string; }>; }; export default async function Page({ params }: PageProps) { const { slug } = await params; const article = await getWikiPageBySlug(slug); if (!article) { notFound(); } return (

{article.title}

{article.updatedAt && (

Zuletzt aktualisiert: {article.updatedAt}

)}
); }