Beautifully designed Nuxt Content template built with shadcn-vue. Customizable. Compatible. Open Source.
- 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 dev
- Clone this repository.
- Install dependencies
bun install
. - Use
bun run dev
to start dev server. - Before committing, run
bun run lint:fix
andbun run typecheck
.
- 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.
- unovue/inspira-ui 1.9K ⭐️
- motion-vue 1.5K ⭐️
- nuxt-monaco-editor
- nuxt-umami
- Msty
- Add your project 🚀
Solution: Add the following to the components section in nuxt.config.ts:
global: true,
Source: https://github.com/nuxt/content/issues/2443#issuecomment-1944028599
- Define
prefix
as/docs
incontent.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.
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.
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
.
This occurs when triggering redirect in [...slug].vue