Play online

You can start playing with Nuxt Content in your browser using our online sandboxes:

Or open the embedded playground.

New Project

  1. You can start a fresh Nuxt Content project with:
npx nuxi@latest init content-app -t content

It will ask you with which package manager you want to install the dependencies.

  1. Move into the content-app folder and start the development server:
pnpm run dev

Add to a project

You can add Nuxt Content at anytime during your Nuxt project development by installing the @nuxt/content module:

npx nuxi@latest module add content

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

export default defineNuxtConfig({
  modules: [
    '@nuxt/content'
  ],
  content: {
    // ... options
  }
})

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>

Surround

[
  {
    "title": "I am a partial",
    "path": "/content-v2/_partials/hello-world",
    "stem": "content-v2/_partials/hello-world",
    "description": "With some Hello World text."
  },
  {
    "title": "Edge Channel",
    "path": "/content-v2/get-started/edge-channel",
    "stem": "content-v2/1.get-started/4.edge-channel",
    "description": "Nuxt Content is landing commits, improvements, and bug fixes every day. You can opt-in to test them earlier before the next release."
  }
]