Nuxt Content reads the content/ directory in your project and parses .md, .yml, .csv and .json files to create a file-based CMS for your application.
Install the @nuxt/content module in your project as well as adding it to your nuxt.config.ts with one command:
npx nuxt module add content
Place your markdown files inside the content/ directory:
# Hello Content
The module automatically loads and parses them.
To render content pages, add a catch-all route using the <ContentRenderer> component:
<script lang="ts" setup>
const route = useRoute()
const { data: page } = await useAsyncData(route.path, () => {
return queryCollection('content').path(route.path).first()
})
</script>
<template>
<div>
<header><!-- ... --></header>
<ContentRenderer
v-if="page"
:value="page"
/>
<footer><!-- ... --></footer>
</div>
</template>