|
1 | | -import { DocsBody, DocsPage } from "fumadocs-ui/page"; |
2 | | -import type { Metadata } from "next"; |
3 | | -import { notFound } from "next/navigation"; |
4 | | -import { source } from "@/app/source"; |
5 | | -import defaultComponents from "fumadocs-ui/mdx"; |
6 | | -import { Tab, Tabs } from "fumadocs-ui/components/tabs"; |
7 | | -import { TypeTable } from "fumadocs-ui/components/type-table"; |
8 | | -import { Accordion, Accordions } from "fumadocs-ui/components/accordion"; |
9 | | -import { Heading } from "fumadocs-ui/components/heading"; |
10 | | -import { ThemeAwareSVG } from "@/components/theme-aware-svg"; |
11 | | -import Link from "fumadocs-core/link"; |
12 | | -import { CodeBlock, Pre } from "fumadocs-ui/components/codeblock"; |
13 | | -import { Step, Steps } from "fumadocs-ui/components/steps"; |
14 | | -import { Callout } from "fumadocs-ui/components/callout"; |
15 | | -import { ImageZoom } from "fumadocs-ui/components/image-zoom"; |
16 | | -import { |
17 | | - GoogelPlayIcon, |
18 | | - SvgComponent, |
19 | | - SvgComponent2, |
20 | | - SvgComponentTest, |
21 | | -} from "@/components/images"; |
22 | | -import { Separator } from "@/components/seperator"; |
23 | | -import CommandTable from "@/components/table"; |
24 | | - |
25 | | -export default async function Page(props: { |
26 | | - params: Promise<{ slug?: string[] }>; |
27 | | -}) { |
28 | | - const params = await props.params; |
29 | | - const page = source.getPage(params.slug); |
30 | | - if (!page) notFound(); |
31 | | - |
32 | | - const MDX = page.data.body; |
33 | | - |
34 | | - const path = `/content/docs/${page.file.path}`; |
35 | | - |
36 | | - return ( |
37 | | - <DocsPage |
38 | | - toc={page.data.toc} |
39 | | - full={page.data.full} |
40 | | - tableOfContent={{ |
41 | | - style: "clerk", |
42 | | - single: false, |
43 | | - }} |
44 | | - editOnGithub={{ |
45 | | - owner: "minima-global", |
46 | | - repo: "docs", |
47 | | - sha: "main", |
48 | | - path: path, |
49 | | - }} |
50 | | - > |
51 | | - <DocsBody> |
52 | | - <h1>{page.data.title}</h1> |
53 | | - <MDX |
54 | | - components={{ |
55 | | - ...defaultComponents, |
56 | | - ThemeAwareSVG, |
57 | | - Tabs, |
58 | | - Tab, |
59 | | - ImageZoom, |
60 | | - TypeTable, |
61 | | - Accordion, |
62 | | - Accordions, |
63 | | - Heading, |
64 | | - Link, |
65 | | - SvgComponent, |
66 | | - SvgComponent2, |
67 | | - SvgComponentTest, |
68 | | - Steps, |
69 | | - Step, |
70 | | - GoogelPlayIcon, |
71 | | - CommandTable, |
72 | | - Separator, |
73 | | - Callout, |
74 | | - pre: ({ ref: _ref, ...props }) => ( |
75 | | - <CodeBlock {...props}> |
76 | | - <Pre className=" max-h-[400px]">{props.children}</Pre> |
77 | | - </CodeBlock> |
78 | | - ), |
79 | | - }} |
80 | | - /> |
81 | | - </DocsBody> |
82 | | - </DocsPage> |
83 | | - ); |
84 | | -} |
85 | | - |
86 | | -export async function generateStaticParams() { |
87 | | - return source.generateParams(); |
88 | | -} |
89 | | - |
90 | | -export async function generateMetadata(props: { |
91 | | - params: Promise<{ slug?: string[] }>; |
92 | | -}) { |
93 | | - const params = await props.params; |
94 | | - const page = source.getPage(params.slug); |
95 | | - if (!page) notFound(); |
96 | | - |
97 | | - return { |
98 | | - title: page.data.title, |
99 | | - description: page.data.description, |
100 | | - twitter: { |
101 | | - card: "summary_large_image", |
102 | | - }, |
103 | | - }; |
104 | | -} |
| 1 | +import { DocsBody, DocsPage } from "fumadocs-ui/page"; |
| 2 | +import type { Metadata } from "next"; |
| 3 | +import { notFound } from "next/navigation"; |
| 4 | +import { source } from "@/app/source"; |
| 5 | +import defaultComponents from "fumadocs-ui/mdx"; |
| 6 | +import { Tab, Tabs } from "fumadocs-ui/components/tabs"; |
| 7 | +import { TypeTable } from "fumadocs-ui/components/type-table"; |
| 8 | +import { Accordion, Accordions } from "fumadocs-ui/components/accordion"; |
| 9 | +import { Heading } from "fumadocs-ui/components/heading"; |
| 10 | +import { ThemeAwareSVG } from "@/components/theme-aware-svg"; |
| 11 | +import Link from "fumadocs-core/link"; |
| 12 | +import { CodeBlock, Pre } from "fumadocs-ui/components/codeblock"; |
| 13 | +import { Step, Steps } from "fumadocs-ui/components/steps"; |
| 14 | +import { Callout } from "fumadocs-ui/components/callout"; |
| 15 | +import { ImageZoom } from "fumadocs-ui/components/image-zoom"; |
| 16 | +import { |
| 17 | + GoogelPlayIcon, |
| 18 | + SvgComponent, |
| 19 | + SvgComponent2, |
| 20 | + SvgComponentTest, |
| 21 | +} from "@/components/images"; |
| 22 | +import { Separator } from "@/components/seperator"; |
| 23 | +import CommandTable from "@/components/table"; |
| 24 | + |
| 25 | +export default async function Page(props: { |
| 26 | + params: Promise<{ slug?: string[] }>; |
| 27 | +}) { |
| 28 | + const params = await props.params; |
| 29 | + const page = source.getPage(params.slug); |
| 30 | + if (!page) notFound(); |
| 31 | + |
| 32 | + const MDX = page.data.body; |
| 33 | + |
| 34 | + const path = `/content/docs/${page.file.path}`; |
| 35 | + |
| 36 | + return ( |
| 37 | + <DocsPage |
| 38 | + toc={page.data.toc} |
| 39 | + full={page.data.full} |
| 40 | + tableOfContent={{ |
| 41 | + style: "clerk", |
| 42 | + single: false, |
| 43 | + }} |
| 44 | + editOnGithub={{ |
| 45 | + owner: "minima-global", |
| 46 | + repo: "docs", |
| 47 | + sha: "main", |
| 48 | + path: path, |
| 49 | + }} |
| 50 | + > |
| 51 | + <DocsBody> |
| 52 | + <h1>{page.data.title}</h1> |
| 53 | + <MDX |
| 54 | + components={{ |
| 55 | + ...defaultComponents, |
| 56 | + ThemeAwareSVG, |
| 57 | + Tabs, |
| 58 | + Tab, |
| 59 | + ImageZoom, |
| 60 | + TypeTable, |
| 61 | + Accordion, |
| 62 | + Accordions, |
| 63 | + Heading, |
| 64 | + Link, |
| 65 | + SvgComponent, |
| 66 | + SvgComponent2, |
| 67 | + SvgComponentTest, |
| 68 | + Steps, |
| 69 | + Step, |
| 70 | + GoogelPlayIcon, |
| 71 | + CommandTable, |
| 72 | + Separator, |
| 73 | + Callout, |
| 74 | + pre: ({ ref: _ref, ...props }) => ( |
| 75 | + <CodeBlock {...props}> |
| 76 | + <Pre className=" max-h-[400px]">{props.children}</Pre> |
| 77 | + </CodeBlock> |
| 78 | + ), |
| 79 | + }} |
| 80 | + /> |
| 81 | + </DocsBody> |
| 82 | + </DocsPage> |
| 83 | + ); |
| 84 | +} |
| 85 | + |
| 86 | +export async function generateStaticParams() { |
| 87 | + return source.generateParams(); |
| 88 | +} |
| 89 | + |
| 90 | +export async function generateMetadata(props: { |
| 91 | + params: Promise<{ slug?: string[] }>; |
| 92 | +}) { |
| 93 | + const params = await props.params; |
| 94 | + const page = source.getPage(params.slug); |
| 95 | + if (!page) notFound(); |
| 96 | + |
| 97 | + return { |
| 98 | + title: page.data.title, |
| 99 | + description: page.data.description, |
| 100 | + twitter: { |
| 101 | + card: "summary_large_image", |
| 102 | + }, |
| 103 | + }; |
| 104 | +} |
0 commit comments