From 52ac15d619a254da580e997d4f5b3cd6f3afec32 Mon Sep 17 00:00:00 2001 From: ZTL-UwU Date: Fri, 24 May 2024 23:17:00 +0800 Subject: [PATCH] feat: header & footer Signed-off-by: ZTL-UwU --- app.config.ts | 45 +++++++++++++++ components/DarkModeToggle.vue | 4 +- components/layout/Aside.vue | 13 +++-- components/layout/AsideTree.vue | 2 +- components/layout/AsideTreeItem.vue | 84 ++++++++++++++-------------- components/layout/Footer.vue | 24 +++++++- components/layout/Header.vue | 21 ++++++- components/layout/HeaderLogo.vue | 13 +++++ components/layout/MobileNav.vue | 3 +- components/layout/Toc.vue | 3 +- composables/useConfig.ts | 40 +++++++++++++ pages/[...slug].vue | 9 +-- public/favicon.ico | Bin 4286 -> 1376 bytes public/logo-dark.svg | 17 ++++++ public/logo.svg | 17 ++++++ 15 files changed, 235 insertions(+), 60 deletions(-) create mode 100644 app.config.ts create mode 100644 components/layout/HeaderLogo.vue create mode 100644 composables/useConfig.ts create mode 100644 public/logo-dark.svg create mode 100644 public/logo.svg diff --git a/app.config.ts b/app.config.ts new file mode 100644 index 00000000..7401fde9 --- /dev/null +++ b/app.config.ts @@ -0,0 +1,45 @@ +export default defineAppConfig({ + shadcnDocs: { + header: { + title: 'shadcn-docs', + showTitle: true, + logo: { + light: '/logo.svg', + dark: '/logo-dark.svg', + }, + darkModeToggle: true, + links: [{ + icon: 'lucide:github', + to: 'https://github.com/ZTL-UwU/shadcn-docs-nuxt', + target: '_blank', + }], + }, + aside: { + useLevel: true, + collapse: false, + }, + main: { + breadCrumb: true, + showTitle: true, + }, + footer: { + credits: 'Copyright © 2024', + links: [ + { + title: 'shadcn-vue', + to: 'https://www.shadcn-vue.com/', + target: '_blank', + }, + { + icon: 'lucide:github', + to: 'https://github.com/ZTL-UwU/shadcn-docs-nuxt', + target: '_blank', + }, + ], + }, + toc: { + enable: true, + title: 'On This Page', + }, + }, +}); diff --git a/components/DarkModeToggle.vue b/components/DarkModeToggle.vue index 2d884162..5fdc8091 100644 --- a/components/DarkModeToggle.vue +++ b/components/DarkModeToggle.vue @@ -1,7 +1,7 @@ diff --git a/components/layout/Aside.vue b/components/layout/Aside.vue index ec89ae6b..03f56d71 100644 --- a/components/layout/Aside.vue +++ b/components/layout/Aside.vue @@ -1,6 +1,6 @@