shadcn-docs-nuxt-v3
v0.8.21-alpha.2
Published
Effortless and beautiful docs template built with Nuxt Content & shadcn-vue.
Maintainers
Readme
shadcn-docs-nuxt
Beautifully designed Nuxt Content template built with shadcn-vue. Customizable. Compatible. Open Source.
Quick Start
- Create a project with the starter template
npx nuxi@latest init -t github:ZTL-UwU/shadcn-docs-nuxt-starter- Navigating to the Project Directory
cd [project-name]- Start dev server
npm run devContributing
- Clone this repository.
- Install dependencies
bun install. - Use
bun run devto start dev server. - Before committing, run
bun run lint:fixandbun run typecheck.
Credits
- Nuxt Content: Content made easy for Vue Developers.
- shadcn-ui: For the beautiful component & docs design.
- shadcn-vue: For the vue port of shadcn-ui & some docs component source.
- Docus: For the inspiration & some docs component source.
- Nuxt UI Pro Docs: For the inspiration.
Who's Using
License
Migration Issues
CodeGroup Component Not Showing in PmX
Solution: Add the following to the components section in nuxt.config.ts:
global: true,Source: https://github.com/nuxt/content/issues/2443#issuecomment-1944028599
Navigation Routing Issues
Solution 1: Define prefix as /docs
- Define
prefixas/docsincontent.config.ts - This allows useContent to directly get content through
queryCollection(doc_${locale.value}).path(route.path).first(); - In navigation, since we defined /docs, we get the root path /docs navigation with only one object, so we need to get the children of the first object once:
export async function useNavigation() {
const { locale } = useI18n();
const { data } = await useAsyncData('navigation', () => {
return queryCollectionNavigation(`doc_${locale.value}`)
});
return {
navigation: computed(() => data.value?.[0]?.children),
};
}Note: This approach doesn't support multilingual functionality.
Solution 2: Remove prefix to default
Set i18n.strategy: 'prefix' in nuxt.config.ts.
This ensures correct path linking in navigation.
The only issue is that all pages will have language prefixes like /en and /zh.
Known Issues
Code blocks not displaying correctly in pm-x parsing
Syntax highlighting is not working. However, it works fine when displaying code blocks directly.
Related migration: Official change from ProseCode to ProsePre, and ProseCodeInline to ProseCode.
Icons not showing in file tree files
Brief 404 flash when clicking navigation
This occurs when triggering redirect in [...slug].vue
