Nuxt/docs/content/1.docs/2.guide/2.directory-structure/1.content.md
Sébastien Chopin 90784f79d7
docs: new website design (#9007)
* docs: implement new website theme

* chore: rename dirs

* chore: update build

* lint fix

* chore: update deps

* fix: include node_modules in esbuild step

* chore: update deps

* Update .gitignore

* chore: update theme version

* up

* up

* fix: use svg for illustration

* chore: update to 0.0.12

* chore: force parse5 resolution

* stay with build

* feat: always display first home section

* Update yarn.lock

* chore: update theme

* fix lint

* docs: update home title

* chore: update website theme version

* Update docs/content/0.index.md

Co-authored-by: pooya parsa <pyapar@gmail.com>

* Update docs/content/0.index.md

Co-authored-by: pooya parsa <pyapar@gmail.com>

* up

* chore: bump theme version

* up

* chore: up

* up up and up

* chore: generate

* fix: boolean value

* feat: new images

* update again

* chore: up

* ouep

* chore: up

Co-authored-by: Daniel Roe <daniel@roe.dev>
Co-authored-by: Clément Ollivier <clement.o2p@gmail.com>
Co-authored-by: pooya parsa <pyapar@gmail.com>
2022-11-16 11:04:28 +01:00

1.8 KiB

navigation.icon title head.title description
IconDirectory content Content The Content module reads the content/ directory to create a file-based CMS for your application.

Content Directory

The Nuxt Content module reads the content/ directory in your project and parses .md, .yml, .csv and .json files to create a file-based CMS for your application.

::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.

::

Get Started

Installation

Install the @nuxt/content module in your project:

::code-group

yarn add --dev @nuxt/content
npm install --save-dev @nuxt/content
pnpm add -D @nuxt/content

::

Then, add @nuxt/content to the modules section of nuxt.config.ts:

export default defineNuxtConfig({
  modules: [
    '@nuxt/content'
  ],
  content: {
    // https://content.nuxtjs.org/api/configuration
  }
})

Create Content

Place your markdown files inside the content/ directory in the root directory of your project:

# Hello Content

The module automatically loads and parses them.

Render Pages

To render content pages, add a catch-all route using the ContentDoc component:

<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. ::