npx skills add https://github.com/onmax/nuxt-skills --skill nuxt-content为内容驱动的 Nuxt 应用提供渐进式指导,支持类型化集合和 SQL 后端查询。
适用于以下场景:
content.config.ts、defineCollection)defineCollectionSource 连接的外部 API)queryCollection、导航、搜索)<ContentRenderer>、文本组件)content:file:beforeParse、content:file:afterParse)nuxt-llms)广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
如需编写文档: 使用 document-writer 技能 如需了解 Nuxt 基础知识: 使用 nuxt 技能 如需部署到 NuxtHub: 使用 nuxthub 技能(兼容 NuxtHub v1)
根据当前工作内容阅读特定文件:
根据您的任务考虑加载以下参考文件:
请勿一次性加载所有文件。 仅加载与您当前任务相关的文件。
| 概念 | 用途 |
|---|---|
| 集合 | 带有模式的类型化内容分组 |
| 页面 vs 数据 | page = 路由 + 正文,data = 仅结构化数据 |
| 远程源 | source.repository 用于 GitHub,defineCollectionSource 用于 API |
| queryCollection | 用于内容的类 SQL 流式 API |
| MDC | Markdown 中的 Vue 组件 |
| ContentRenderer | 渲染解析后的 markdown 正文 |
// content.config.ts
import { defineCollection, defineContentConfig, z } from '@nuxt/content'
export default defineContentConfig({
collections: {
blog: defineCollection({
type: 'page',
source: 'blog/**',
schema: z.object({
title: z.string(),
date: z.date(),
}),
}),
},
})
<!-- pages/blog/[...slug].vue -->
<script setup lang="ts">
const { data: page } = await useAsyncData(
() => queryCollection('blog').path(useRoute().path).first()
)
</script>
<template>
<ContentRenderer v-if="page" :value="page" />
</template>
验证设置: 运行 npx nuxi typecheck 以确认集合类型解析正常。如果 queryCollection 返回空结果,请检查内容文件是否存在于与您的 source 通配符匹配的路径中。
project/
├── content/ # 内容文件
│ ├── blog/ # 映射到 'blog' 集合
│ └── .navigation.yml # 导航元数据
├── components/content/ # MDC 组件
└── content.config.ts # 集合定义
主技能:约 300 令牌。每个子文件:约 800-1200 令牌。仅加载与当前任务相关的文件。
每周安装量
927
代码仓库
GitHub 星标数
606
首次出现
2026年1月19日
安全审计
安装于
opencode680
gemini-cli676
codex649
github-copilot644
cursor603
claude-code548
Progressive guidance for content-driven Nuxt apps with typed collections and SQL-backed queries.
Working with:
content.config.ts, defineCollection)defineCollectionSource)queryCollection, navigation, search)<ContentRenderer>, prose components)content:file:beforeParse, content:file:afterParse)nuxt-llms)For writing documentation: use document-writer skill For Nuxt basics: use nuxt skill For NuxtHub deployment: use nuxthub skill (NuxtHub v1 compatible)
Read specific files based on current work:
Consider loading these reference files based on your task:
DO NOT load all files at once. Load only what's relevant to your current task.
| Concept | Purpose |
|---|---|
| Collections | Typed content groups with schemas |
| Page vs Data | page = routes + body, data = structured data only |
| Remote sources | source.repository for GitHub, defineCollectionSource for APIs |
| queryCollection | SQL-like fluent API for content |
| MDC | Vue components inside markdown |
| ContentRenderer | Renders parsed markdown body |
// content.config.ts
import { defineCollection, defineContentConfig, z } from '@nuxt/content'
export default defineContentConfig({
collections: {
blog: defineCollection({
type: 'page',
source: 'blog/**',
schema: z.object({
title: z.string(),
date: z.date(),
}),
}),
},
})
<!-- pages/blog/[...slug].vue -->
<script setup lang="ts">
const { data: page } = await useAsyncData(
() => queryCollection('blog').path(useRoute().path).first()
)
</script>
<template>
<ContentRenderer v-if="page" :value="page" />
</template>
Verify setup: Run npx nuxi typecheck to confirm collection types resolve. If queryCollection returns empty, check that content files exist in the path matching your source glob.
project/
├── content/ # Content files
│ ├── blog/ # Maps to 'blog' collection
│ └── .navigation.yml # Navigation metadata
├── components/content/ # MDC components
└── content.config.ts # Collection definitions
Main skill: ~300 tokens. Each sub-file: ~800-1200 tokens. Only load files relevant to current task.
Weekly Installs
927
Repository
GitHub Stars
606
First Seen
Jan 19, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
opencode680
gemini-cli676
codex649
github-copilot644
cursor603
claude-code548
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装
Gemini Interactions API 指南:统一接口、智能体交互与服务器端状态管理
833 周安装
Apollo MCP 服务器:让AI代理通过GraphQL API交互的完整指南
834 周安装
智能体记忆系统构建指南:分块策略、向量存储与检索优化
835 周安装
Scrapling官方网络爬虫框架 - 自适应解析、绕过Cloudflare、Python爬虫库
836 周安装
抽奖赢家选取器 - 随机选择工具,支持CSV、Excel、Google Sheets,公平透明
838 周安装
Medusa 前端开发指南:使用 SDK、React Query 构建电商商店
839 周安装