2022-07-07 18:27:34 +00:00
---
2022-10-06 09:15:30 +00:00
navigation.icon: IconDirectory
2022-07-07 18:27:34 +00:00
title: 'content'
2022-11-21 15:51:39 +00:00
head.title: 'content/'
2022-10-06 09:15:30 +00:00
description: The Content module reads the content/ directory to create a file-based CMS for your application.
2022-07-07 18:27:34 +00:00
---
2022-08-13 07:27:04 +00:00
# Content Directory
2022-07-07 18:27:34 +00:00
2023-07-07 16:24:09 +00:00
The [Nuxt Content module ](https://content.nuxtjs.org ) reads the [`content/` directory ](/docs/guide/directory-structure/content ) in your project and parses `.md` , `.yml` , `.csv` and `.json` files to create a file-based CMS for your application.
2022-07-07 18:27:34 +00:00
::list{type=success}
- Render your content with built-in components.
- Query your content with a MongoDB-like API.
- Use your Vue components in Markdown files with the MDC syntax.
- Automatically generate your navigation.
::
2022-08-13 07:27:04 +00:00
## Get Started
2022-07-07 18:27:34 +00:00
### Installation
Install the `@nuxt/content` module in your project:
::code-group
```bash [yarn]
yarn add --dev @nuxt/content
```
```bash [npm]
npm install --save-dev @nuxt/content
```
```bash [pnpm]
pnpm add -D @nuxt/content
```
::
Then, add `@nuxt/content` to the `modules` section of `nuxt.config.ts` :
```ts [nuxt.config.ts]
export default defineNuxtConfig({
modules: [
'@nuxt/content'
],
content: {
// https://content.nuxtjs.org/api/configuration
}
})
```
2022-08-13 07:27:04 +00:00
### Create Content
2022-07-07 18:27:34 +00:00
2023-07-07 16:24:09 +00:00
Place your markdown files inside the [`content/` directory ](/docs/guide/directory-structure/content ) in the root directory of your project:
2022-07-07 18:27:34 +00:00
```md [content/index.md]
# Hello Content
```
The module automatically loads and parses them.
2022-08-13 07:27:04 +00:00
### Render Pages
2022-07-07 18:27:34 +00:00
2022-11-16 10:04:28 +00:00
To render content pages, add a [catch-all route ](/docs/guide/directory-structure/pages/#catch-all-route ) using the `ContentDoc` component:
2022-07-07 18:27:34 +00:00
```vue [pages/[...slug].vue]
< template >
< main >
< ContentDoc / >
< / main >
< / template >
```
## Documentation
::alert{type=info}
Head over to < https: / / content . nuxtjs . org > to learn more about the Content module features, such as how to build queries and use Vue components in your Markdown files with the MDC syntax.
::