-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: ZTL-UwU <[email protected]>
- Loading branch information
Showing
15 changed files
with
235 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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', | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,25 @@ | ||
<template> | ||
<footer class="py-6 md:px-8 md:py-0"> | ||
<div class="container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row"> | ||
Footer | ||
<footer class="text-muted-foreground py-6 md:px-8 md:py-0"> | ||
<div class="container flex flex-col items-center justify-between gap-2 md:h-24 md:flex-row"> | ||
<span class="text-sm"> | ||
{{ footer.credits }} | ||
</span> | ||
<span class="flex-1" /> | ||
<NuxtLink | ||
v-for="(link, i) in footer.links" | ||
:key="i" | ||
:to="link?.to" | ||
:target="link?.target" | ||
> | ||
<UiButton variant="ghost" :size="link?.icon && !link?.title ? 'icon' : 'default'" class="flex gap-2"> | ||
<Icon v-if="link?.icon" :name="link.icon" size="20" /> | ||
<span v-if="link?.title">{{ link.title }}</span> | ||
</UiButton> | ||
</NuxtLink> | ||
</div> | ||
</footer> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
const { footer } = useConfig().value; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,29 @@ | ||
<template> | ||
<header class="sticky z-40 top-0 bg-background/80 backdrop-blur-lg lg:border-b"> | ||
<div class="container px-4 md:px-8 flex h-14 max-w-screen-2xl items-center border-b lg:border-none"> | ||
<LayoutHeaderLogo class="hidden md:flex" /> | ||
<LayoutMobileNav /> | ||
|
||
<span class="flex-1" /> | ||
<DarkModeToggle /> | ||
|
||
<DarkModeToggle v-if="config.header.darkModeToggle" /> | ||
<NuxtLink | ||
v-for="(link, i) in config.header.links" | ||
:key="i" | ||
:to="link?.to" | ||
:target="link?.target" | ||
> | ||
<UiButton variant="ghost" size="icon" class="flex gap-2"> | ||
<Icon v-if="link?.icon" :name="link.icon" size="18" /> | ||
</UiButton> | ||
</NuxtLink> | ||
</div> | ||
<div class="lg:hidden"> | ||
<div v-if="config.toc.enable" class="lg:hidden"> | ||
<LayoutToc is-small /> | ||
</div> | ||
</header> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
const config = useConfig(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<template> | ||
<NuxtLink v-if="logo.light && logo.dark" to="/" class="flex"> | ||
<img :src="logo.light" class="dark:hidden h-7"> | ||
<img :src="logo.dark" class="hidden dark:block h-7"> | ||
<span v-if="showTitle && title" class="self-center font-bold ml-3"> | ||
{{ title }} | ||
</span> | ||
</NuxtLink> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
const { logo, title, showTitle } = useConfig().value.header; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
export function useConfig() { | ||
const appConfig = computed(() => useAppConfig()?.shadcnDocs || {}); | ||
|
||
const { navKeyFromPath } = useContentHelpers(); | ||
const { navigation, page } = useContent(); | ||
const route = useRoute(); | ||
|
||
return computed( | ||
() => { | ||
const header = appConfig?.value?.header || {}; | ||
const main = appConfig?.value?.main || {}; | ||
const aside = appConfig?.value?.aside || {}; | ||
const footer = appConfig?.value?.footer || {}; | ||
|
||
return { | ||
...appConfig.value, | ||
header: { | ||
...header, | ||
...navKeyFromPath(route.path, 'header', navigation.value || []), | ||
...page.value?.header, | ||
} as typeof header, | ||
main: { | ||
...main, | ||
...navKeyFromPath(route.path, 'main', navigation.value || []), | ||
...page.value?.main, | ||
} as typeof main, | ||
aside: { | ||
...aside, | ||
...navKeyFromPath(route.path, 'aside', navigation.value || []), | ||
...page.value?.aside, | ||
} as typeof aside, | ||
footer: { | ||
...footer, | ||
...navKeyFromPath(route.path, 'footer', navigation.value || []), | ||
...page.value?.footer, | ||
} as typeof footer, | ||
}; | ||
}, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.