Merge remote-tracking branch 'Gitea/main' into style/adjust-receiver-page
This commit is contained in:
commit
b3870265f6
23 files changed
+2596
-139
No files matched your search
@@ -1,7 +1,9 @@
|
||||
// @wikiCategory: Liederbücher
|
||||
|
||||
import { NextResponse } from "next/server";
|
||||
import { getSongbooks, addSongbook } from "@/lib/db/managing";
|
||||
|
||||
|
||||
// @wikiDescription: Liste aller Liederbücher abrufen
|
||||
export async function GET() {
|
||||
try {
|
||||
const songbooks = await getSongbooks();
|
||||
@@ -10,6 +12,8 @@ export async function GET() {
|
||||
return NextResponse.json({ success: false, message: error}, { status: 500})
|
||||
}
|
||||
}
|
||||
|
||||
// @wikiDescription: Neues Liederbuch erstellen
|
||||
export async function POST(request: Request) {
|
||||
try {
|
||||
const { name, language } = await request.json();
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// @wikiCategory: Lieder
|
||||
|
||||
import { NextResponse } from "next/server";
|
||||
import { getSongInfos } from "@/lib/db/managing";
|
||||
|
||||
// @wikiDescription: Informationen eines Liedes abrufen
|
||||
export async function GET(
|
||||
request: Request,
|
||||
{ params }: { params: Promise<{ id: string }> }
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// @wikiCategory: Lieder
|
||||
|
||||
import { NextResponse } from "next/server";
|
||||
import { attachSongToSongbook } from "@/lib/db/managing";
|
||||
|
||||
// @wikiDescription: Lied zu einem Liederbuch hinzufügen
|
||||
export async function POST(request: Request) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// @wikiCategory: Lieder
|
||||
|
||||
import { NextResponse } from "next/server";
|
||||
import { removeSongfromSongbook } from "@/lib/db/managing";
|
||||
|
||||
// @wikiDescription: Lied von einem Liederbuch entfernen
|
||||
export async function POST(request: Request) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
// @wikiCategory: Lieder
|
||||
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
import { getSongs, addSongToSongbook } from "@/lib/db/managing";
|
||||
|
||||
// @wikiDescription: Liste aller Lieder abrufen
|
||||
export async function GET() {
|
||||
const songs = await getSongs();
|
||||
if (songs) {
|
||||
@@ -10,6 +13,8 @@ export async function GET() {
|
||||
return NextResponse.json({ success: false}, { status: 500})
|
||||
}
|
||||
}
|
||||
|
||||
// @wikiDescription: Lied in einem Liederbuch erstellen
|
||||
export async function POST(request: Request) {
|
||||
try {
|
||||
const { title, songbookId, number } = await request.json();
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// @wikiCategory: Stream
|
||||
|
||||
import { NextResponse } from "next/server";
|
||||
import { getSong } from "@/lib/db/managing";
|
||||
|
||||
@@ -8,10 +10,12 @@ let currentSong = {
|
||||
title: ""
|
||||
};
|
||||
|
||||
// @wikiDescription: Akutell gestreamtes Lied abrufen
|
||||
export async function GET() {
|
||||
return NextResponse.json(currentSong)
|
||||
}
|
||||
|
||||
// @wikiDescription: Lied zum Streamen festlegen
|
||||
export async function POST(request: Request) {
|
||||
try {
|
||||
const data = await request.json();
|
||||
|
||||
+127
@@ -29,3 +29,130 @@ section {
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
/* Shiki Code-Blöcke stylen */
|
||||
pre {
|
||||
padding: 1rem;
|
||||
border-radius: 0.75rem;
|
||||
border: 1px solid #27272a; /* Tailwind zinc-800 */
|
||||
overflow-x: auto;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
pre code {
|
||||
background-color: transparent !important;
|
||||
padding: 0 !important;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
/* Shiki / Rehype Pretty Code Block Container */
|
||||
figure[data-rehype-pretty-code-figure] {
|
||||
margin-top: 1.5rem;
|
||||
margin-bottom: 1.5rem;
|
||||
border-radius: 0.75rem;
|
||||
overflow: hidden;
|
||||
border: 1px solid #27272a; /* Tailwind zinc-800 */
|
||||
background-color: #0d1117; /* Dunkler VS-Code Hintergrund */
|
||||
}
|
||||
|
||||
/* Der Titel/Dateiname (falls im MDX angegeben) */
|
||||
div[data-rehype-pretty-code-title] {
|
||||
background-color: #161b22;
|
||||
border-bottom: 1px solid #27272a;
|
||||
padding: 0.5rem 1rem;
|
||||
font-family: monospace;
|
||||
font-size: 0.75rem;
|
||||
color: #8b949e;
|
||||
}
|
||||
|
||||
/* Der eigentliche Code-Bereich */
|
||||
figure[data-rehype-pretty-code-figure] pre {
|
||||
margin: 0 !important;
|
||||
padding: 1rem !important;
|
||||
background-color: transparent !important;
|
||||
overflow-x: auto;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
figure[data-rehype-pretty-code-figure] code {
|
||||
font-family: var(--font-mono, monospace);
|
||||
}
|
||||
|
||||
/* Container für den Code-Block */
|
||||
/* Container für den Code-Block */
|
||||
figure[data-rehype-pretty-code-figure] {
|
||||
position: relative;
|
||||
margin-top: 1.5rem;
|
||||
margin-bottom: 1.5rem;
|
||||
border-radius: 0.75rem;
|
||||
overflow: hidden;
|
||||
border: 1px solid #27272a;
|
||||
background-color: #0d1117;
|
||||
}
|
||||
|
||||
/* Leeres Pseudo-Element der Figure deaktivieren */
|
||||
figure[data-rehype-pretty-code-figure]::before {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Sprach-Badge links oben */
|
||||
figure[data-rehype-pretty-code-figure] pre[data-language]::before {
|
||||
content: attr(data-language);
|
||||
display: block !important;
|
||||
position: absolute;
|
||||
top: 0.6rem;
|
||||
left: 0.5rem;
|
||||
font-family: var(--font-mono, ui-monospace, monospace);
|
||||
font-size: 0.68rem;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
color: #a1a1aa;
|
||||
background-color: #18181b;
|
||||
border: 1px solid #27272a;
|
||||
padding: 0.15rem 0.5rem;
|
||||
border-radius: 0.375rem;
|
||||
pointer-events: none;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
/* Platz oben im Code-Block */
|
||||
figure[data-rehype-pretty-code-figure] pre {
|
||||
margin: 0 !important;
|
||||
padding: 1rem !important;
|
||||
padding-top: 2.6rem !important; /* Platz für Badge & Button */
|
||||
background-color: transparent !important;
|
||||
overflow-x: auto;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
scroll-margin-top: 5rem; /* <-- Höhe deines Headers + etwas Abstand */
|
||||
}
|
||||
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
/* Anchor-Link Styling */
|
||||
.heading-anchor {
|
||||
opacity: 0;
|
||||
margin-right: 1em; /* Abstand zum nachfolgenden Text */
|
||||
color: #3b82f6; /* Tailwind blue-500 */
|
||||
text-decoration: none;
|
||||
font-weight: 800;
|
||||
transition: opacity 0.15s ease-in-out;
|
||||
}
|
||||
|
||||
h1:hover .heading-anchor,
|
||||
h2:hover .heading-anchor,
|
||||
h3:hover .heading-anchor,
|
||||
h4:hover .heading-anchor,
|
||||
.heading-anchor:focus {
|
||||
opacity: 1;
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
import { getWikiPageBySlug } from '@/lib/wiki';
|
||||
import { notFound } from 'next/navigation';
|
||||
import { MDXRemote } from 'next-mdx-remote/rsc';
|
||||
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: {
|
||||
rehypePlugins: [
|
||||
rehypeSlug, // creates heading-ids automaticly
|
||||
[
|
||||
rehypeAutolinkHeadings,
|
||||
{
|
||||
behavior: 'prepend', // symbol is PRE header
|
||||
properties: {
|
||||
className: ['heading-anchor'],
|
||||
ariaHidden: 'true',
|
||||
tabIndex: -1,
|
||||
},
|
||||
content: {
|
||||
type: 'text',
|
||||
value: ' #', // symbol
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
rehypePrettyCode,
|
||||
{
|
||||
theme: 'github-dark',
|
||||
keepBackground: true,
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
const mdxComponents = {
|
||||
// Eigene UI-Komponenten
|
||||
Callout,
|
||||
Grid,
|
||||
Card,
|
||||
Steps,
|
||||
Step,
|
||||
API,
|
||||
// Custom Typography Überschreibungen
|
||||
code: InlineCode,
|
||||
pre: CodeBlockContainer,
|
||||
h1: (props: any) => <h1 className="text-3xl font-bold text-white mt-8 mb-4 border-b border-zinc-800 pb-3" {...props} />,
|
||||
h2: (props: any) => <h2 className="text-2xl font-bold text-white mt-10 mb-4" {...props} />,
|
||||
h3: (props: any) => <h3 className="text-xl font-semibold text-white mt-6 mb-3" {...props} />,
|
||||
};
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
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>
|
||||
|
||||
// <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>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import { getAllApis } from "@/lib/wiki";
|
||||
import Article from '@/components/wiki/Article';
|
||||
import { API } from '@/components/mdx-components';
|
||||
|
||||
export default async function Page() {
|
||||
const allApis = await getAllApis();
|
||||
|
||||
// Gruppiert die APIs nach ihrer Kategorie
|
||||
const groupedApis = Object.groupBy(allApis, (api) => api.category);
|
||||
|
||||
return (
|
||||
<Article title="API-Endpunkte">
|
||||
{Object.entries(groupedApis).map(([category, apis]) => (
|
||||
<div key={category} className="mb-10">
|
||||
{/* Kategorie-Überschrift wird nur EINMAL pro Kategorie gerendert */}
|
||||
<h2 className="text-2xl font-bold text-white mt-10 mb-4 border-b border-zinc-800 pb-2">
|
||||
{category}
|
||||
</h2>
|
||||
|
||||
{/* Routen innerhalb dieser Kategorie durchgehen */}
|
||||
{apis?.map((api, index) => (
|
||||
<div key={index} className="my-4">
|
||||
{api.methods.map((method, mIndex) => (
|
||||
<API route={api.route} method={method.method} key={mIndex}>
|
||||
{method.description}
|
||||
</API>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</Article>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import Article from "@/components/wiki/Article";
|
||||
import { getAllWikiPages } from "@/lib/wiki";
|
||||
|
||||
export default async function WikiIndexPage() {
|
||||
const allPages = await getAllWikiPages();
|
||||
return (
|
||||
<Article title="Wiki">
|
||||
<div className="flex flex-col gap-2">
|
||||
{allPages.map(({ title, path }) => (
|
||||
<a key={path} href={`/wiki/${path}`} className="hover:underline">
|
||||
{title}
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</Article>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user