Skip to content

Commit d63ad38

Browse files
committed
fix: update docs
1 parent a107fa0 commit d63ad38

24 files changed

Lines changed: 557 additions & 2604 deletions

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.2.4/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.3.4/schema.json",
33
"vcs": {
44
"enabled": false,
55
"clientKind": "git",

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
"@radix-ui/react-scroll-area": "^1.2.10",
1919
"class-variance-authority": "^0.7.1",
2020
"clsx": "^2.1.1",
21-
"fumadocs-core": "16.0.7",
22-
"fumadocs-mdx": "13.0.5",
21+
"fumadocs-core": "16.2.3",
22+
"fumadocs-mdx": "14.1.0",
2323
"fumadocs-typescript": "^4.0.12",
24-
"fumadocs-ui": "16.0.7",
24+
"fumadocs-ui": "16.2.3",
2525
"lucide-react": "^0.552.0",
2626
"mermaid": "^11.12.1",
2727
"next": "16.0.7",
@@ -30,7 +30,9 @@
3030
"react-dom": "^19.2.0",
3131
"rehype-stringify": "^10.0.1",
3232
"remark": "^15.0.1",
33-
"tailwind-merge": "^3.3.1"
33+
"shiki": "^3.19.0",
34+
"tailwind-merge": "^3.3.1",
35+
"zod": "^4.1.13"
3436
},
3537
"devDependencies": {
3638
"@biomejs/biome": "^2.3.4",

pnpm-lock.yaml

Lines changed: 411 additions & 104 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source.config.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,35 @@ import {
55
frontmatterSchema,
66
metaSchema,
77
} from "fumadocs-mdx/config";
8+
import jsonSchema from "fumadocs-mdx/plugins/json-schema";
9+
import lastModified from "fumadocs-mdx/plugins/last-modified";
10+
import { z } from "zod";
811

912
// You can customise Zod schemas for frontmatter and `meta.json` here
1013
// see https://fumadocs.dev/docs/mdx/collections#define-docs
1114
export const docs = defineDocs({
1215
docs: {
1316
schema: frontmatterSchema,
17+
postprocess: {
18+
includeProcessedMarkdown: true,
19+
},
20+
async: true,
1421
},
1522
meta: {
16-
schema: metaSchema,
23+
schema: metaSchema.extend({
24+
description: z.string().optional(),
25+
}),
1726
},
1827
});
1928

2029
export default defineConfig({
21-
lastModifiedTime: "git",
30+
plugins: [
31+
jsonSchema({
32+
insert: true,
33+
}),
34+
lastModified(),
35+
],
36+
// lastModifiedTime: "git",
2237
mdxOptions: {
2338
rehypePlugins: (v) => [rehypeCode, ...v],
2439
},

src/app/[lang]/(docs)/[...slug]/page.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { createRelativeLink } from "fumadocs-ui/mdx";
2-
import type { Metadata } from "next";
3-
import { notFound } from "next/navigation";
41
import {
52
DocsBody,
63
DocsDescription,
74
DocsPage,
85
DocsTitle,
9-
} from "@/components/layout/page";
6+
} from "fumadocs-ui/layouts/docs/page";
7+
import { createRelativeLink } from "fumadocs-ui/mdx";
8+
import type { Metadata } from "next";
9+
import { notFound } from "next/navigation";
1010
import { LLMCopyButton, ViewOptions } from "@/components/page-actions";
1111
import { source } from "@/lib/source";
1212
import { getMDXComponents } from "@/mdx-components";
@@ -21,10 +21,10 @@ export default async function Page({ params }: Props) {
2121

2222
if (!page) notFound();
2323

24-
const MDXContent = page.data.body;
24+
const { body: MDXContent, toc, lastModified } = await page.data.load();
2525

2626
return (
27-
<DocsPage toc={page.data.toc} full={page.data.full}>
27+
<DocsPage toc={toc}>
2828
<DocsTitle>{page.data.title}</DocsTitle>
2929
<DocsDescription className="mb-0">
3030
{page.data.description}

src/app/[lang]/(docs)/layout.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { DocsLayout } from "fumadocs-ui/layouts/docs";
12
import type { ReactNode } from "react";
23
import { LegalFooter } from "@/components/LegalFooter";
3-
import { DocsLayout } from "@/components/layout/docs";
44
import { baseOptions } from "@/lib/layout.shared";
55
import { source } from "@/lib/source";
66

@@ -18,8 +18,17 @@ export default async function Layout({
1818
return (
1919
<DocsLayout
2020
{...base}
21-
tabMode="navbar"
22-
nav={{ ...nav, mode: "top" }}
21+
//tabMode="top"
22+
nav={{
23+
...nav,
24+
title: (
25+
<>
26+
<span className="font-medium in-[.uwu]:hidden max-md:hidden">
27+
Kopexa
28+
</span>
29+
</>
30+
),
31+
}}
2332
tree={source.pageTree[lang]}
2433
>
2534
{children}

src/app/[lang]/layout.tsx

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
11
import "@/app/global.css";
2-
import { defineI18nUI } from "fumadocs-ui/i18n";
3-
import { RootProvider } from "fumadocs-ui/provider";
2+
import { NextProvider } from "fumadocs-core/framework/next";
3+
import { TreeContextProvider } from "fumadocs-ui/contexts/tree";
44
import { Inter } from "next/font/google";
55
import { BackgroundPattern } from "@/components/background-pattern";
6-
import { i18n } from "@/lib/i18n";
6+
import { source } from "@/lib/source";
7+
import { Provider } from "./provider";
78

89
const inter = Inter({
910
subsets: ["latin"],
1011
});
1112

12-
const { provider } = defineI18nUI(i18n, {
13-
translations: {
14-
en: {
15-
displayName: "English",
16-
},
17-
de: {
18-
displayName: "German",
19-
search: "Suchen...",
20-
},
21-
},
22-
});
23-
2413
export default async function Layout({
2514
params,
2615
children,
@@ -34,20 +23,11 @@ export default async function Layout({
3423
<html lang={lang} className={inter.className} suppressHydrationWarning>
3524
<body className="flex flex-col min-h-screen" suppressHydrationWarning>
3625
<BackgroundPattern />
37-
<RootProvider
38-
search={{
39-
enabled: true,
40-
hotKey: [
41-
{
42-
display: "K",
43-
key: "k", // key code, or a function determining whether the key is pressed
44-
},
45-
],
46-
}}
47-
i18n={provider(lang)}
48-
>
49-
{children}
50-
</RootProvider>
26+
<NextProvider>
27+
<TreeContextProvider tree={source.pageTree[lang]}>
28+
<Provider lang={lang}>{children}</Provider>
29+
</TreeContextProvider>
30+
</NextProvider>
5131
</body>
5232
</html>
5333
);

src/app/[lang]/provider.tsx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { defineI18nUI } from "fumadocs-ui/i18n";
2+
import { RootProvider } from "fumadocs-ui/provider/base";
3+
import type { ReactNode } from "react";
4+
import { i18n } from "@/lib/i18n";
5+
6+
const { provider } = defineI18nUI(i18n, {
7+
translations: {
8+
en: {
9+
displayName: "English",
10+
},
11+
de: {
12+
displayName: "German",
13+
search: "Suchen...",
14+
},
15+
},
16+
});
17+
18+
export function Provider({
19+
children,
20+
lang,
21+
}: {
22+
children: ReactNode;
23+
lang: string;
24+
}) {
25+
return (
26+
<RootProvider
27+
search={{
28+
enabled: true,
29+
hotKey: [
30+
{
31+
display: "K",
32+
key: "k", // key code, or a function determining whether the key is pressed
33+
},
34+
],
35+
}}
36+
i18n={provider(lang)}
37+
>
38+
{children}
39+
</RootProvider>
40+
);
41+
}

src/app/sitemap.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ export const revalidate = false;
77
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
88
const url = (path: string): string => new URL(path, baseUrl).toString();
99

10+
const items = await Promise.all(
11+
source.getPages().map(async (page) => {
12+
// if (page.data.type === "openapi") return;
13+
const { lastModified } = await page.data.load();
14+
15+
return {
16+
url: url(page.url),
17+
lastModified: lastModified ? new Date(lastModified) : undefined,
18+
changeFrequency: "weekly",
19+
priority: 0.5,
20+
} as MetadataRoute.Sitemap[number];
21+
}),
22+
);
23+
1024
return [
1125
{
1226
url: url("/"),
@@ -23,16 +37,6 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
2337
// changeFrequency: "monthly",
2438
// priority: 0.8,
2539
// },
26-
...(await Promise.all(
27-
source.getPages().map(async (page) => {
28-
const lastModified = page.data.lastModified;
29-
return {
30-
url: url(page.url),
31-
lastModified: lastModified ? new Date(lastModified) : undefined,
32-
changeFrequency: "weekly",
33-
priority: 0.5,
34-
} as MetadataRoute.Sitemap[number];
35-
}),
36-
)),
40+
...items.filter((v) => v !== undefined),
3741
];
3842
}

0 commit comments

Comments
 (0)