Skip to content

Commit 4857cdb

Browse files
committed
WIP cca4a
1 parent 489731f commit 4857cdb

File tree

4 files changed

+101
-0
lines changed

4 files changed

+101
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
#nd-page
6+
> article
7+
> div.prose
8+
> div
9+
> div
10+
> div.min-w-0.flex-1
11+
> form
12+
> div.flex.flex-row.items-center.gap-2.text-sm
13+
> button {
14+
color: white !important;
15+
}
16+
17+
.dark {
18+
#nd-page
19+
> article
20+
> div.prose
21+
> div
22+
> div
23+
> div.min-w-0.flex-1
24+
> form
25+
> div.flex.flex-row.items-center.gap-2.text-sm
26+
> button {
27+
color: black !important;
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import {
2+
DocsPage,
3+
DocsBody,
4+
DocsTitle,
5+
DocsDescription,
6+
} from "fumadocs-ui/page";
7+
import { notFound } from "next/navigation";
8+
import defaultMdxComponents from "fumadocs-ui/mdx";
9+
import { openapi, openapiPages } from "@/app/source";
10+
// eslint-disable-next-line rulesdir/global-css
11+
import "./openapi.css";
12+
13+
export default async function Page(props: {
14+
params: Promise<{ slug?: string[] }>;
15+
}): Promise<JSX.Element> {
16+
const params = await props.params;
17+
const page = openapiPages.getPage(params.slug);
18+
19+
if (!page) {
20+
notFound();
21+
}
22+
23+
const Mdx = page.data.body;
24+
25+
return (
26+
<DocsPage full={page.data.full} toc={page.data.toc}>
27+
<DocsTitle>{page.data.title}</DocsTitle>
28+
<DocsDescription>{page.data.description}</DocsDescription>
29+
<DocsBody>
30+
<Mdx
31+
components={{
32+
...defaultMdxComponents,
33+
APIPage: openapi.APIPage,
34+
}}
35+
/>
36+
</DocsBody>
37+
</DocsPage>
38+
);
39+
}
40+
41+
export function generateStaticParams(): { slug: string[] }[] {
42+
return openapiPages.generateParams();
43+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import type { ReactNode } from "react";
2+
import { DocsLayout } from "fumadocs-ui/layouts/docs";
3+
import { layoutPropsWithSidebar } from "@/app/_components/inner-layout-props";
4+
import { openapiPages } from "@/app/source";
5+
6+
export default function Layout({
7+
children,
8+
}: {
9+
children: ReactNode;
10+
}): JSX.Element {
11+
return (
12+
<DocsLayout
13+
{...layoutPropsWithSidebar}
14+
sidebar={{ defaultOpenLevel: 3, collapsible: false }}
15+
tree={openapiPages.pageTree}
16+
>
17+
{children}
18+
</DocsLayout>
19+
);
20+
}
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import type { ReactNode } from "react";
2+
3+
export default function Layout({
4+
children,
5+
}: {
6+
children: ReactNode;
7+
}): JSX.Element {
8+
return <>{children}</>;
9+
}

0 commit comments

Comments
 (0)