Skip to content

Commit 883fee5

Browse files
committed
refactor: use DocsList in mdx instead of auto render docs based on path
1 parent 9d5b184 commit 883fee5

File tree

204 files changed

+1175
-2416
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+1175
-2416
lines changed
+1-1

content/blocks/index.mdx

+12

content/blocks/marketing/index.mdx

+5-1
+3-1

content/components/core/index.mdx

-6
This file was deleted.

content/components/feedback/index.mdx

+5

content/components/index.mdx

+31

content/components/inputs/index.mdx

+5
+15

content/components/layout/index.mdx

+5
+5

content/components/overlay/index.mdx

+5

content/components/utils/index.mdx

+5

content/docs/changelog.mdx

+4

content/docs/index.mdx

+4

content/docs/installation.mdx

+4

content/docs/theming.mdx

+4

content/getting-started/introduction.mdx

-4
This file was deleted.

content/hooks/browser/index.mdx

+5

content/hooks/elements/index.mdx

+5

content/hooks/index.mdx

+20

content/hooks/sensors/index.mdx

+5

content/hooks/state/index.mdx

+5

content/hooks/utils/index.mdx

+5

scripts/build-docs-config.ts

+49-8
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,76 @@
11
import fs from "fs";
22
import path from "path";
33
import { rimraf } from "rimraf";
4-
import { getAllCategoryDocs } from "@/utils/docs";
54
import type { DocsConfig } from "@/types/docs";
5+
import { getDocs } from "@/server/docs";
66

77
const getCategoryItems = (category: string) => {
8-
return getAllCategoryDocs(category).map((category) => ({
8+
return getDocs(category).map((category) => ({
99
title: category.title,
1010
href: category.href,
1111
label: category.label,
1212
}));
1313
};
1414

1515
const docsConfig: DocsConfig = {
16-
sidebarNav: [
16+
nav: [
1717
{
1818
title: "Getting Started",
19-
slug: "getting-started",
20-
items: getCategoryItems("getting-started"),
19+
slug: "docs",
20+
items: [
21+
{
22+
title: "Introduction",
23+
href: "/docs",
24+
},
25+
{
26+
title: "Installation",
27+
href: "/docs/installation",
28+
},
29+
{
30+
title: "Theming",
31+
href: "/docs/theming",
32+
},
33+
{
34+
title: "Changelog",
35+
href: "/docs/changelog",
36+
},
37+
],
2138
},
2239
{
2340
title: "Components",
2441
slug: "components",
2542
items: [
2643
{
27-
title: "All components",
44+
title: "Overview",
2845
href: "/components",
2946
},
3047
{
31-
title: "Core",
32-
items: getCategoryItems("components/core"),
48+
title: "Inputs",
49+
items: getCategoryItems("components/inputs"),
50+
},
51+
{
52+
title: "Feedback",
53+
items: getCategoryItems("components/feedback"),
54+
},
55+
{
56+
title: "Layout",
57+
items: getCategoryItems("components/layout"),
58+
},
59+
{
60+
title: "Data display",
61+
items: getCategoryItems("components/data-display"),
62+
},
63+
{
64+
title: "Navigation",
65+
items: getCategoryItems("components/navigation"),
66+
},
67+
{
68+
title: "Overlay",
69+
items: getCategoryItems("components/overlay"),
70+
},
71+
{
72+
title: "Utils",
73+
items: getCategoryItems("components/utils"),
3374
},
3475
{
3576
title: "Animations",

scripts/build-previews.ts

-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ const getAllPreviews = () => {
4444

4545
const allPreviews = getAllPreviews();
4646

47-
console.log(allPreviews);
48-
4947
let index = `
5048
// This file is autogenerated by scripts/build-preview-imports.ts
5149
// Do not edit this file directly.

0 commit comments

Comments
 (0)