All skills
onmax avatar

/nuxt-content

@f6ed5e1

Build typed, content-driven Nuxt applications with @nuxt/content. Use when working with content.config.ts, collections, queryCollection, Markdown or MDC rendering, content databases, hooks, custom sources, search, or Content v2 migrations.

  • 7 files
  • 19.8 KB
  • MIT
  • Updated 2 months ago
  • GitHub

Use this Skill: https://skilld.dev/gh/onmax/claude-config/nuxt-content

This session only. Nothing lands on disk.

referencesrendering.md

≈681 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Rendering

ContentRenderer

Query a page document, handle the missing state at the route boundary, then pass the document to ContentRenderer.

<script setup lang="ts">
const route = useRoute()
const { data: page } = await useAsyncData(route.path, () => {
  return queryCollection('docs').path(route.path).first()
})

if (!page.value) {
  throw createError({ statusCode: 404, statusMessage: 'Page not found' })
}
</script>

<template>
  <ContentRenderer :value="page" />
</template>

Nuxt Content v3 renders documents through ContentRenderer; document-driven routing still belongs in an explicit Nuxt page such as app/pages/[...slug].vue.

MDC components

Components under components/content/ are available in Markdown and MDC.

:icon{name="lucide:star"}

::callout{type="warning"}
Review this before publishing.
::

::card
#title
Typed collections

#default
The body is rendered through the default slot.
::

Use native slots in content components. The mdc-unwrap attribute removes Markdown wrapper elements when a component needs the raw slot shape.

<template>
  <aside class="callout">
    <slot mdc-unwrap="p" />
  </aside>
</template>

Content components are registered for MDC rendering. Register them separately when they also need dynamic use outside Markdown.

Prose components

Override semantic Markdown output with ProseP, ProseA, ProseH1–ProseH6, ProseCode, ProsePre, ProseImg, ProseTable, and the matching list/blockquote components. Inline code maps to ProseCode; fenced code maps to ProsePre.

Keep accessible HTML semantics and forward the attributes supplied by MDC. Let a design-system skill own styling decisions when Nuxt UI or another component library is installed.

Markdown processing and highlighting

Configure Markdown under content.build.markdown and renderer aliases under content.renderer.

export default defineNuxtConfig({
  content: {
    build: {
      markdown: {
        toc: { depth: 3, searchDepth: 2 },
        highlight: {
          themes: {
            default: 'github-light',
            dark: 'github-dark',
          },
          langs: ['ts', 'vue', 'bash'],
        },
      },
    },
    renderer: {
      alias: { a: 'DocsLink' },
      anchorLinks: { h2: true, h3: true },
    },
  },
})

Load only the Shiki languages used by the content set. When custom remark or rehype plugins are involved, verify the rendered AST and the final SSR HTML.

Official references: Markdown and MDC, ContentRenderer, prose components.

Source: SKILL.md on GitHub

No third-party reports yet.

Signed by skilld at f6ed5e1. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 15 hours ago.

Activeupdated 2 months ago

README badge

README badge for onmax/claude-config/nuxt-content