From abe5c49ecc1a431e13ff28f12d0635c07afd41f5 Mon Sep 17 00:00:00 2001 From: ZTL-UwU Date: Sat, 25 May 2024 20:47:58 +0800 Subject: [PATCH] feat: add landing page Signed-off-by: ZTL-UwU --- app.config.ts | 77 ++++++++ components/content/Alert.vue | 4 +- components/content/CodeCopy.vue | 36 ++++ components/content/CodeGroup.vue | 71 +++++++ components/content/CodeGroupHeader.vue | 45 +++++ components/content/Hero.vue | 61 ++++++ components/content/Preview.vue | 14 ++ components/content/ProseCode.vue | 54 +---- components/layout/Aside.vue | 2 +- components/layout/AsideTree.vue | 2 +- components/layout/AsideTreeItem.vue | 15 +- components/layout/Header/Nav.vue | 2 +- components/ui/separator/Separator.vue | 20 ++ components/ui/separator/index.ts | 1 + components/ui/tabs/Tabs.vue | 15 ++ components/ui/tabs/TabsContent.vue | 22 +++ components/ui/tabs/TabsList.vue | 25 +++ components/ui/tabs/TabsTrigger.vue | 27 +++ components/ui/tabs/index.ts | 4 + content/1.getting-started/1.Introduction.md | 17 ++ content/1.getting-started/1.aaa/1.aaa.md | 186 ------------------ .../1.getting-started/1.aaa/1.bbb/_dir.yml | 2 - content/1.getting-started/1.aaa/2.bbb.md | 7 - content/1.getting-started/1.aaa/_dir.yml | 2 - content/1.getting-started/2.installation.md | 7 + .../1.getting-started/3.writing/1.markdown.md | 13 ++ .../3.writing/2.components.md | 185 +++++++++++++++++ content/1.getting-started/3.writing/_dir.yml | 3 + content/1.getting-started/_dir.yml | 1 + content/1.getting-started/index.md | 3 - content/2.api/1.configuration.md | 7 + content/2.api/2.composables.md | 7 + content/2.api/_dir.yml | 3 + content/3.folder2/1.ccc.md | 3 - content/3.folder2/_dir.yml | 3 - content/index.md | 77 ++------ layouts/default.vue | 2 + pages/[...slug].vue | 2 - pages/index.vue | 19 ++ 39 files changed, 722 insertions(+), 324 deletions(-) create mode 100644 components/content/CodeCopy.vue create mode 100644 components/content/CodeGroup.vue create mode 100644 components/content/CodeGroupHeader.vue create mode 100644 components/content/Hero.vue create mode 100644 components/content/Preview.vue create mode 100644 components/ui/separator/Separator.vue create mode 100644 components/ui/separator/index.ts create mode 100644 components/ui/tabs/Tabs.vue create mode 100644 components/ui/tabs/TabsContent.vue create mode 100644 components/ui/tabs/TabsList.vue create mode 100644 components/ui/tabs/TabsTrigger.vue create mode 100644 components/ui/tabs/index.ts create mode 100644 content/1.getting-started/1.Introduction.md delete mode 100644 content/1.getting-started/1.aaa/1.aaa.md delete mode 100644 content/1.getting-started/1.aaa/1.bbb/_dir.yml delete mode 100644 content/1.getting-started/1.aaa/2.bbb.md delete mode 100644 content/1.getting-started/1.aaa/_dir.yml create mode 100644 content/1.getting-started/2.installation.md create mode 100644 content/1.getting-started/3.writing/1.markdown.md create mode 100644 content/1.getting-started/3.writing/2.components.md create mode 100644 content/1.getting-started/3.writing/_dir.yml delete mode 100644 content/1.getting-started/index.md create mode 100644 content/2.api/1.configuration.md create mode 100644 content/2.api/2.composables.md create mode 100644 content/2.api/_dir.yml delete mode 100644 content/3.folder2/1.ccc.md delete mode 100644 content/3.folder2/_dir.yml create mode 100644 pages/index.vue diff --git a/app.config.ts b/app.config.ts index 88e86bd1..c27cf266 100644 --- a/app.config.ts +++ b/app.config.ts @@ -12,6 +12,19 @@ export default defineAppConfig({ }, darkModeToggle: true, nav: [{ + title: 'Docs', + links: [{ + title: 'Getting Started', + to: '/getting-started', + description: 'For the beautiful component design & docs design', + target: undefined, + }, { + title: 'API', + to: '/api', + description: 'For the vue port of shadcn-ui & some docs component source', + target: undefined, + }], + }, { title: 'Credits', links: [{ title: 'shadcn-ui', @@ -91,6 +104,7 @@ export default defineAppConfig({ 'yarn': 'vscode-icons:file-type-yarn', 'bun': 'vscode-icons:file-type-bun', 'yml': 'vscode-icons:file-type-yaml', + 'json': 'vscode-icons:file-type-json', 'terminal': 'lucide:terminal', }, }, @@ -119,3 +133,66 @@ export default defineAppConfig({ }, }, }); + +declare module '@nuxt/schema' { + interface AppConfigInput { + shadcnDocs?: { + site: { + name: string; + }; + header: { + title: string; + showTitle: true; + logo: { + light: string; + dark: string; + }; + darkModeToggle: true; + nav: ({ + title: string; + to?: string; + target?: string; + links?: ({ + title: string; + to: string; + target?: string; + description?: string; + })[]; + })[]; + links: ({ + icon: string; + to: string; + target: string; + })[]; + }; + aside: { + useLevel: boolean; + collapse: boolean; + }; + main: { + breadCrumb: boolean; + showTitle: boolean; + codeIcon: { + [key: string]: string; + }; + }; + footer: { + credits: string; + links: ({ + icon?: string; + title?: string; + to: string; + target?: string; + })[]; + }; + toc: { + enable: boolean; + title: string; + }; + search: { + enable: boolean; + inAside: boolean; + }; + }; + } +} diff --git a/components/content/Alert.vue b/components/content/Alert.vue index d3ffb8ae..79b3f74d 100644 --- a/components/content/Alert.vue +++ b/components/content/Alert.vue @@ -4,13 +4,13 @@ :class="[typeTwClass[type], to && 'cursor-pointer hover:bg-zinc-50 dark:hover:bg-zinc-900']" @click="alertClick" > - + {{ title }}
- + diff --git a/components/content/CodeCopy.vue b/components/content/CodeCopy.vue new file mode 100644 index 00000000..e30a8f95 --- /dev/null +++ b/components/content/CodeCopy.vue @@ -0,0 +1,36 @@ + + + diff --git a/components/content/CodeGroup.vue b/components/content/CodeGroup.vue new file mode 100644 index 00000000..1572dc1a --- /dev/null +++ b/components/content/CodeGroup.vue @@ -0,0 +1,71 @@ + + + diff --git a/components/content/CodeGroupHeader.vue b/components/content/CodeGroupHeader.vue new file mode 100644 index 00000000..8ddcc123 --- /dev/null +++ b/components/content/CodeGroupHeader.vue @@ -0,0 +1,45 @@ + + + diff --git a/components/content/Hero.vue b/components/content/Hero.vue new file mode 100644 index 00000000..cd34ad7e --- /dev/null +++ b/components/content/Hero.vue @@ -0,0 +1,61 @@ + + + diff --git a/components/content/Preview.vue b/components/content/Preview.vue new file mode 100644 index 00000000..e9d7301a --- /dev/null +++ b/components/content/Preview.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/content/ProseCode.vue b/components/content/ProseCode.vue index 32124ea7..6ad2b810 100644 --- a/components/content/ProseCode.vue +++ b/components/content/ProseCode.vue @@ -1,47 +1,19 @@ diff --git a/components/layout/AsideTree.vue b/components/layout/AsideTree.vue index 644d27cf..2a71ad1f 100644 --- a/components/layout/AsideTree.vue +++ b/components/layout/AsideTree.vue @@ -1,5 +1,5 @@