chore: basic @nuxt/content setup
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<NuxtLayout>
|
||||||
<NuxtRouteAnnouncer />
|
<NuxtPage />
|
||||||
<NuxtWelcome />
|
</NuxtLayout>
|
||||||
</div>
|
</template>
|
||||||
</template>
|
|
||||||
13
app/pages/index.vue
Normal file
13
app/pages/index.vue
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
const { data: home } = await useAsyncData(() => queryCollection('content').path('/').first())
|
||||||
|
|
||||||
|
useSeoMeta({
|
||||||
|
title: home.value?.title,
|
||||||
|
description: home.value?.description
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ContentRenderer v-if="home" :value="home" />
|
||||||
|
<div v-else>Home not found</div>
|
||||||
|
</template>
|
||||||
10
content.config.ts
Normal file
10
content.config.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import { defineContentConfig, defineCollection } from '@nuxt/content'
|
||||||
|
|
||||||
|
export default defineContentConfig({
|
||||||
|
collections: {
|
||||||
|
content: defineCollection({
|
||||||
|
type: 'page',
|
||||||
|
source: '**/*.md'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
3
content/index.md
Normal file
3
content/index.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# My First Page
|
||||||
|
|
||||||
|
Here is some content.
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
compatibilityDate: '2025-07-15',
|
compatibilityDate: '2025-07-15',
|
||||||
devtools: { enabled: true }
|
content: {
|
||||||
|
experimental: { nativeSqlite: true }
|
||||||
|
},
|
||||||
|
devtools: { enabled: true },
|
||||||
|
modules: ['@nuxt/content']
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
"postinstall": "nuxt prepare"
|
"postinstall": "nuxt prepare"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@nuxt/content": "^3.8.2",
|
||||||
|
"better-sqlite3": "^12.5.0",
|
||||||
"nuxt": "^4.2.1",
|
"nuxt": "^4.2.1",
|
||||||
"vue": "^3.5.25",
|
"vue": "^3.5.25",
|
||||||
"vue-router": "^4.6.3"
|
"vue-router": "^4.6.3"
|
||||||
|
|||||||
2032
pnpm-lock.yaml
generated
2032
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user