Skip to content

Commit

Permalink
feat(Content): Nuxt Content Linking
Browse files Browse the repository at this point in the history
  • Loading branch information
sfxcode committed Jun 13, 2022
1 parent 8bcadf2 commit 9176904
Show file tree
Hide file tree
Showing 7 changed files with 746 additions and 701 deletions.
2 changes: 1 addition & 1 deletion composables/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function useNavigationMenu() {
{
label: 'Content',
items: [
{ label: 'Markdown', icon: 'pi pi-fw pi-user-edit', to: '/files/markdown' },
{ label: 'Markdown', icon: 'pi pi-fw pi-user-edit', to: '/cms/markdown' },
],
},
{
Expand Down
2 changes: 1 addition & 1 deletion content/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Hello World Form **Nuxt Content V2**

[Link](/api/components/prose)
[Link](/cms/sample)

### Code

Expand Down
5 changes: 5 additions & 0 deletions content/sample.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Nuxt Content

Sample Page

[Markdown](/cms/markdown)
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
"@nuxtjs/color-mode": "^3.0.2",
"@pinia/nuxt": "^0.1.8",
"@sfxcode/formkit-primevue": "^0.5.3",
"@unocss/nuxt": "^0.37.2",
"@unocss/nuxt": "^0.39.0",
"@vitejs/plugin-vue": "^2.3.1",
"@vitest/ui": "^0.13.0",
"@vitest/ui": "^0.14.1",
"@vueuse/nuxt": "^8.3.1",
"c8": "^7.11.2",
"eslint": "^8.15.0",
"nuxt": "^3.0.0-rc.3",
"sass": "^1.51.0",
"typescript": "^4.6.4",
"vitest": "^0.13.0"
"typescript": "^4.7.3",
"vitest": "^0.14.1"
}
}
19 changes: 19 additions & 0 deletions pages/cms/[...slug].vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<script setup lang='ts'>
const route = useRoute()
const slug = route.params.slug.toString()
</script>

<template>
<div class="markdown">
<ContentDoc :path="slug">
<!-- Slot if document is not found -->
<template #not-found>
<h1 class="text-2xl">
Content Page ({{ slug }}) not found
</h1>
</template>
</contentdoc>
</div>
</template>

<style scoped></style>
10 changes: 0 additions & 10 deletions pages/files/markdown.vue

This file was deleted.

Loading

0 comments on commit 9176904

Please sign in to comment.