Feat/wiki #37

Merged
robin merged 19 commits from feat/wiki into main 2026-08-05 10:58:32 +00:00
6 changed files with 660 additions and 24 deletions
Showing only changes of commit 18f8496af9 - Show all commits

No files matched your search

+13 -16
View File
@@ -1,31 +1,28 @@
import { getWikiPageBySlug } from '@/lib/wiki';
import { notFound } from 'next/navigation';
import { MDXRemote } from 'next-mdx-remote/rsc';
import { Callout } from '@/components/markdown/Callout';
const components = {
Callout,
};
type PageProps = {
params: Promise<{
slug: string;
}>;
};
export default async function Page({ params }: PageProps) { const { slug } = await params;
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 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} />
</article>
);
}
+11
View File
@@ -0,0 +1,11 @@
export function Callout({ children, type = 'info' }: { children: React.ReactNode; type?: 'info' | 'warning' }) {
const styles = type === 'warning'
? 'bg-amber-500/10 border-amber-500 text-amber-200'
: 'bg-blue-500/10 border-blue-500 text-blue-200';
return (
<div className={`p-4 my-4 rounded-lg border-l-4 ${styles}`}>
{children}
</div>
);
}
@@ -3,10 +3,11 @@ title: Installation & Setup
updatedAt: "2026-08-04"
----
> [!WARNING]
> Dieses Projekt befindet sich noch in der aktiven Entwicklungsphase. Bitte verwende es noch nicht für den produktiven Einsatz.
<Callout type="warning">
Dieses Projekt befindet sich noch in der **aktiven Entwicklungsphase**. Bitte verwende es noch nicht für den produktiven Einsatz.
</Callout>
## Installation
# Installation
1. Repository klonen:
```bash
@@ -17,7 +18,7 @@ updatedAt: "2026-08-04"
npm install
```
## Setup
# Setup
3. Prisma generieren
```bash
+3 -3
View File
@@ -7,7 +7,7 @@ import html from 'remark-html';
export type WikiArticle = {
slug: string;
title: string;
contentHtml: string;
rawContent: string;
updatedAt?: string;
};
@@ -15,7 +15,7 @@ const wikiDirectory = path.join(process.cwd(), "data/wiki/pages");
export async function getWikiPageBySlug(slug: string): Promise<WikiArticle | null> {
try {
const fullPath = path.join(wikiDirectory, `${slug}.md`);
const fullPath = path.join(wikiDirectory, `${slug}.mdx`);
const fileContents = fs.readFileSync(fullPath, "utf-8");
// read metadata
@@ -29,7 +29,7 @@ export async function getWikiPageBySlug(slug: string): Promise<WikiArticle | nul
return {
slug,
contentHtml,
rawContent: content,
title: data.title || 'Unbenannt',
updatedAt: data.updatedAt || null,
...data,
+6 -1
View File
@@ -13,11 +13,16 @@
"better-sqlite3": "^12.11.1",
"gray-matter": "^4.0.3",
"next": "16.2.9",
"next-mdx-remote": "^6.0.0",
"papaparse": "^5.5.4",
"react": "19.2.4",
"react-dom": "19.2.4",
"rehype-highlight": "^7.0.2",
"rehype-stringify": "^10.0.1",
"remark": "^15.0.1",
"remark-html": "^16.0.1"
"remark-html": "^16.0.1",
"remark-parse": "^11.0.0",
"remark-rehype": "^11.1.2"
},
"devDependencies": {
"@tailwindcss/postcss": "^4",
+622
View File
File diff suppressed because it is too large. Load diff