chore: wiki: add component Article

This commit is contained in:
robin committed 2026-08-06 16:29:39 +02:00
1 parent 3c3a4e309a
commit 28dc1ce6b1
4 files changed
+72 -17

No files matched your search

+20 -12
View File
@@ -5,6 +5,7 @@ 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, API } from '@/components/mdx-components';
import Article from '@/components/wiki/Article';
const mdxOptions = {
mdxOptions: {
@@ -67,19 +68,26 @@ export default async function Page({ params }: PageProps) {
}
return (
<article className="prose prose-invert prose-blue max-w-4xl mx-auto p-6 md:p-12 min-h-screen">
<header className="mb-8 border-b border-zinc-800 pb-6">
<h1 className="text-4xl font-extrabold text-white mb-2 m-0">{article.title}</h1>
{article.updatedAt && (
<p className="text-zinc-500 text-sm m-0">Zuletzt aktualisiert: {article.updatedAt}</p>
)}
</header>
// <article className="prose prose-invert prose-blue max-w-4xl mx-auto p-6 md:p-12 min-h-screen">
// <header className="mb-8 border-b border-zinc-800 pb-6">
// <h1 className="text-4xl font-extrabold text-white mb-2 m-0">{article.title}</h1>
// {article.updatedAt && (
// <p className="text-zinc-500 text-sm m-0">Zuletzt aktualisiert: {article.updatedAt}</p>
// )}
// </header>
// <MDXRemote
// source={article.rawContent}
// components={mdxComponents}
// options={mdxOptions as any}
// />
// </article>
<Article title={article.title} updatedAt={article.updatedAt}>
<MDXRemote
source={article.rawContent}
components={mdxComponents}
options={mdxOptions as any}
/>
</article>
source={article.rawContent}
components={mdxComponents}
options={mdxOptions as any}
/>
</Article>
);
}
+9
View File
@@ -0,0 +1,9 @@
import Article from "@/components/wiki/Article";
export default function Page() {
return (
<Article title="API-Endpunkte">
<p>hi</p>
</Article>
)
}
+22
View File
@@ -0,0 +1,22 @@
import { ReactNode } from "react";
interface ArticleProps {
title: string;
updatedAt?: string;
children: ReactNode
}
export default function Article({ title, updatedAt, children }: ArticleProps) {
return (
<article className="prose prose-invert prose-blue max-w-4xl mx-auto p-6 md:p-12 min-h-screen">
<header className="mb-8 border-b border-zinc-800 pb-6">
<h1 className="text-4xl font-extrabold text-white mb-2 m-0">{title}</h1>
{updatedAt && (
<p className="text-zinc-500 text-sm m-0">Zuletzt aktualisiert: {updatedAt}</p>
)}
</header>
{children}
</article>
);
}
+21 -5
View File
@@ -3,12 +3,8 @@ title: API
updatedAt: "2026-08-05"
---
<Callout type="warning">
Diese Wiki-Seite ist derzeit nur zum Testen da. Bitte Informationen nicht anwenden!
</Callout>
<Callout type="info">
Es weder eine Authentifikation noch ein API-Key notwendig.
Es ist weder eine Authentifikation noch ein API-Key erforderlich.
</Callout>
## API-Endpoints
@@ -20,4 +16,24 @@ updatedAt: "2026-08-05"
</API>
<API method="POST" route="stream/currentID">
Lied zum Anzeigen festlegen
</API>
### Lieder
<API method="GET" route="songs/[id]">
Informationen eines Liedes abrufen
</API>
<API method="POST" route="songs/attach">
Lied zu einem Liederbuch hinzufügen
</API>
<API method="POST" route="songs/attach">
Lied von einem Liederbuch entfernen
</API>
### Liederbücher
<API method="GET" route="songbooks">
Liste aller Liederbücher abrufen
</API>
<API method="POST" route="songbooks">
Neues Liederbuch erstellen
</API>