Index of every page on this site: llms.txt
All skills
onmax avatar

/nuxt-content

@2e74504 official
by Maxonmax/nuxt-skills722 stars
38
Run it yourself

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.

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

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesquerying.md

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

Querying

Page and list queries

Wrap initial render queries in useAsyncData or useFetch so Nuxt can transfer the result in its payload.

const route = useRoute()

const { data: page } = await useAsyncData(route.path, () => {
  return queryCollection('docs').path(route.path).first()
})

const { data: posts } = await useAsyncData('published-posts', () => {
  return queryCollection('blog')
    .where('draft', '=', false)
    .order('date', 'DESC')
    .select('path', 'title', 'description', 'date')
    .limit(12)
    .all()
})

The builder supports where, andWhere, orWhere, order, select, skip, limit, all, first, and count. Use grouped conditions when SQL precedence matters.

const posts = await queryCollection('blog')
  .where('published', '=', true)
  .andWhere(group => group
    .where('date', '>', '2026-01-01')
    .where('category', '=', 'news'))
  .all()

Nitro queries

Pass the event as the first argument on the server so the query uses the request's Content context.

export default defineEventHandler(async (event) => {
  const { slug } = getRouterParams(event)
  return queryCollection(event, 'docs').path(`/${slug}`).first()
})

Extend ../.nuxt/tsconfig.server.json from server/tsconfig.json when server-side collection types are missing.

Navigation and surroundings

const navigation = await queryCollectionNavigation('docs', [
  'title',
  'description',
  'icon',
])

const [previous, next] = await queryCollectionItemSurroundings(
  'docs',
  route.path,
  { fields: ['title', 'description'] },
)

Navigation reads page paths plus .navigation.yml metadata. Surroundings returns a two-item tuple, with null at either boundary.

Search

queryCollectionSearchSections turns headings and their text into a search index suitable for Nuxt UI, MiniSearch, Fuse, or another client-side search engine.

const { data: sections } = await useAsyncData('docs-search', () => {
  return queryCollectionSearchSections('docs', {
    ignoredTags: ['style', 'script'],
    extraFields: ['description'],
  })
})

Use useSearchCollection when the app needs reactive, built-in search over a collection rather than managing an external index. Load the search data once per stable collection and avoid rebuilding an index on every keystroke.

Checks

  • A stable useAsyncData key identifies each payload-backed query.
  • Client and server calls use their correct signatures.
  • select() retains every field the renderer consumes.
  • Pagination applies a deterministic order() before skip() and limit().
  • Search and navigation source globs include the files that generate their metadata.

Official references: queryCollection, navigation, surroundings, search sections.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning1mo5 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The skill provides guidance for using the Nuxt Content module. It correctly emphasizes the use of environment variables for managing sensitive tokens and database credentials. However, the skill’s core functionality involves ingesting data from external sources such as Git repositories and APIs, which introduces a potential surface for indirect prompt injection if those sources are compromised.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: MEDIUM · 1 issue

  • Runlayer8mo

    6 files scanned · No issues

  • ZeroLeaks6mo

    Score: 93/100 · 2 sections analyzed

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

Last checked against GitHub last week.

Activeupdated 4 months ago

README badge

README badge for onmax/nuxt-skills/nuxt-content

Provides guidance for Nuxt Content v3 collections, querying, and rendering—including typed schemas, SQL-backed queries with queryCollection, MDC components, database configuration, and NuxtStudio integration. Use this when building content-driven Nuxt apps with markdown or structured data sources.

Generated from the current SKILL.md.

Does this skill cover NuxtStudio integration?
Yes. The skill includes guidance on NuxtStudio integration, preview mode, and live editing via the studio.md reference file.
Can I use remote content sources like GitHub repos?
Yes. The skill covers defineCollectionSource and source.repository patterns for pulling content from external APIs and GitHub repositories.
Does this skill handle i18n for multi-language content?
Yes. The skill includes patterns for i18n multi-language content setup.
What databases are supported for content storage?
The skill covers configuration for SQLite, PostgreSQL, D1, and LibSQL.
Is this for general Nuxt development or specifically content-driven apps?
This skill is specifically for content-driven Nuxt apps. For general Nuxt basics, use the nuxt skill instead.

Generated from the current SKILL.md. These answers refresh after source changes.