{article.title}
- {/* Direkte MDX-Rendering-Komponente von Next.js */} +{article.title}
+ {article.updatedAt && ( +Zuletzt aktualisiert: {article.updatedAt}
+ )} +{title}
-{title}
-{title}
+ ohne Inline-Styling rendern
+ if (isCodeBlock || className?.includes('language-')) {
+ return {children};
+ }
+
+ // Ansonsten: Unser schickes Inline-Code-Design anwenden
return (
-
+
{children}
);
-}
-
-// 2. Code Block (für mehrzeiligen Code)
-export function PreBlock({ children }: { children?: React.ReactNode }) {
- return (
-
- {/* Optionaler Dekorations-Header für den Codeblock */}
-
-
-
-
-
-
- {children}
-
-
- );
}
\ No newline at end of file
diff --git a/data/wiki/pages/test.mdx b/data/wiki/pages/test.mdx
index c20ee36..b669802 100644
--- a/data/wiki/pages/test.mdx
+++ b/data/wiki/pages/test.mdx
@@ -1,8 +1,9 @@
---
title: Projekt Starten
+updatedAt: "2026-08-04"
---
-# Willkommen im Wiki
+Willkommen im offiziellen Wiki! Hier findest du alle Informationen zum Projekt.
@@ -22,7 +23,7 @@ title: Projekt Starten
Führe den Installer aus:
- `npm install`
+ `pnpm install`
@@ -37,5 +38,4 @@ title: Projekt Starten
```typescript
function sayHello(name: string): string {
return `Hallo, ${name}!`;
-}
-```
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/lib/wiki.ts b/lib/wiki.ts
index 08dbdd4..c674267 100644
--- a/lib/wiki.ts
+++ b/lib/wiki.ts
@@ -1,14 +1,6 @@
import fs from 'fs';
import path from 'path';
import matter from 'gray-matter';
-import { remark } from 'remark';
-import html from 'remark-html';
-import rehypePrettyCode from 'rehype-pretty-code';
-
-const options = {
- theme: 'github-dark', // oder 'nord', 'one-dark-pro', etc.
- keepBackground: true,
-};
export type WikiArticle = {
slug: string;
@@ -20,27 +12,21 @@ export type WikiArticle = {
const wikiDirectory = path.join(process.cwd(), "data/wiki/pages");
export async function getWikiPageBySlug(slug: string): Promise {
- try {
- const fullPath = path.join(wikiDirectory, `${slug}.mdx`);
- const fileContents = fs.readFileSync(fullPath, "utf-8");
+ try {
+ const fullPath = path.join(wikiDirectory, `${slug}.mdx`);
+ const fileContents = fs.readFileSync(fullPath, "utf-8");
- // read metadata
- const { data, content } = matter(fileContents);
+ // Metadaten und Inhalt parsen
+ const { data, content } = matter(fileContents);
- // convert markdown in HTML
- const processedContent = await remark()
- .use(html)
- .process(content);
- const contentHtml = processedContent.toString();
-
- return {
- slug,
- rawContent: content,
- title: data.title || 'Unbenannt',
- updatedAt: data.updatedAt || null,
- ...data,
- } as WikiArticle;
- } catch (error) {
- return null;
- }
+ return {
+ slug,
+ rawContent: content,
+ title: data.title || 'Unbenannt',
+ updatedAt: data.updatedAt || null,
+ ...data,
+ } as WikiArticle;
+ } catch (error) {
+ return null;
+ }
}
\ No newline at end of file