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.

referencesconfig.md

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

Configuration and deployment

Database adapters

Nuxt Content builds a database dump and restores it into the configured adapter at runtime. SQLite is the default.

export default defineNuxtConfig({
  content: {
    database: {
      type: 'sqlite',
      filename: '.data/content/contents.sqlite',
    },
  },
})

Supported adapters include:

  • sqlite with a file path or :memory:; select experimental.sqliteConnector when the runtime needs better-sqlite3, sqlite3, Bun SQLite, or Node's native SQLite.
  • d1 with a Cloudflare binding name.
  • postgresql with pg installed and a connection URL.
  • libsql with @libsql/client, URL, and optional auth token.
  • pglite with @electric-sql/pglite; keep it to development-oriented deployments unless the chosen host provides durable storage.
export default defineNuxtConfig({
  content: {
    database: {
      type: 'd1',
      bindingName: 'CONTENT_DB',
    },
    experimental: {
      sqliteConnector: 'native',
    },
  },
})

Database indexes belong in defineCollection({ indexes: [...] }), because each collection owns its table and query patterns.

Build and renderer options

export default defineNuxtConfig({
  content: {
    build: {
      markdown: {
        toc: { depth: 3, searchDepth: 2 },
        remarkPlugins: {
          'remark-gfm': {},
        },
        rehypePlugins: {
          'rehype-external-links': {
            target: '_blank',
            rel: ['noopener', 'noreferrer'],
          },
        },
        highlight: {
          themes: { default: 'github-light', dark: 'github-dark' },
          langs: ['ts', 'vue', 'bash'],
        },
      },
      csv: { json: true, delimiter: ',' },
    },
    renderer: {
      alias: { a: 'DocsLink' },
      anchorLinks: { h2: true, h3: true },
    },
    watch: { enabled: true },
  },
})

The watcher is a development feature. Transformers are registered under content.build.transformers; load Advanced when processing behavior extends beyond remark/rehype plugins.

Deployment boundary

  • Static generation packages queried content into the generated application.
  • Server and serverless targets restore the generated dump on first query; an in-memory SQLite database is recreated on cold start.
  • Cloudflare Workers use D1 when content must share a durable runtime database.
  • NuxtHub can supply the database configuration through @nuxthub/core; apply the nuxthub skill for provider and binding details.
  • Vercel, Netlify, AWS, Docker, and other targets have provider-specific presets; verify the selected adapter against the deployment filesystem and runtime.

Keep database URLs and tokens in private runtime configuration or build environment variables. Remote collection credentials are build-time inputs; database credentials are runtime inputs when the adapter connects after deployment.

Checks

  • The deployment runtime supports the chosen driver and its peer dependency.
  • Production can restore or reach the database after a cold start.
  • Shiki languages and Markdown plugins are limited to the actual content set.
  • A clean build and a production-mode query both succeed.

Official references: configuration, deployment, NuxtHub.

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