feat: add own wiki
This commit is contained in:
1 parent
5f41e47958
commit
49ed2577ac
5 files changed
+106
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import { getWikiPageBySlug } from '@/lib/wiki';
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
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(); // Zeigt die 404-Seite, wenn z. B. installation.md nicht existiert
|
||||
}
|
||||
|
||||
return (
|
||||
<article className="max-w-3xl mx-auto p-6">
|
||||
<h1 className="text-3xl font-bold mb-2">{article.title}</h1>
|
||||
{article.updatedAt && (
|
||||
<p className="text-sm text-gray-500 mb-6">Stand: {article.updatedAt}</p>
|
||||
)}
|
||||
|
||||
{/* Gerendertes Markdown-HTML anzeigen */}
|
||||
<div
|
||||
className="prose max-w-none"
|
||||
dangerouslySetInnerHTML={{ __html: article.contentHtml }}
|
||||
/>
|
||||
</article>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user