style: add more components and add test wiki page
This commit is contained in:
1 parent
fd4da2a43f
commit
3d82ef9671
5 files changed
+113
-14
No files matched your search
@@ -32,3 +32,15 @@ section {
|
||||
h1 {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.steps-container {
|
||||
counter-reset: step;
|
||||
}
|
||||
|
||||
.steps-container .relative {
|
||||
counter-increment: step;
|
||||
}
|
||||
|
||||
.steps-container .relative div:first-child::before {
|
||||
content: counter(step);
|
||||
}
|
||||
@@ -2,10 +2,15 @@ import { getWikiPageBySlug } from '@/lib/wiki';
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
import { MDXRemote } from 'next-mdx-remote/rsc';
|
||||
import { Callout } from '@/components/markdown/Callout';
|
||||
import { Callout, Grid, Card, Steps, Step } from '@/components/mdx-components';
|
||||
|
||||
const components = {
|
||||
const mdxComponents = {
|
||||
Callout,
|
||||
Grid,
|
||||
Card,
|
||||
Steps,
|
||||
Step,
|
||||
h2: (props: any) => <h2 className="text-2xl font-bold text-white mt-12 mb-4" {...props} />,
|
||||
};
|
||||
|
||||
type PageProps = {
|
||||
@@ -26,7 +31,7 @@ export default async function Page({ params }: PageProps) {
|
||||
<article className="prose prose-invert max-w-none p-6">
|
||||
<h1>{article.title}</h1>
|
||||
{/* Direkte MDX-Rendering-Komponente von Next.js */}
|
||||
<MDXRemote source={article.rawContent} components={components} />
|
||||
<MDXRemote source={article.rawContent} components={mdxComponents} />
|
||||
</article>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user