Skip to content

docs: note about rendering content in Get Started #1255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/content/2.get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,28 @@ export default defineNuxtConfig({
})
```

## Create content

Place your markdown files inside `content` directory in the root directory of your project.

```md [content/index.md]
# Hello Content
```

The module automatically load and parse all of them.

## Render pages

To render content pages, you may wish to add a [catch-all route](https://v3.nuxtjs.org/guide/directory-structure/pages/#catch-all-route) using the `ContentDoc` component to do so:

```vue [pages/[...slug].vue]
<template>
<main>
<ContentDoc />
</main>
</template>
```

::alert{type=warning}
⚠️ Content v2 requires [Nuxt 3](https://v3.nuxtjs.org). If you are using Nuxt 2, checkout [Content v1 documentation](https://content.nuxtjs.org/v1/getting-started/installation).
::
Expand Down