关于 nuxt-content
面向 Nuxt Content v3 开发者的渐进式指导技能,按主题提供类型化集合、内容查询、渲染和配置参考。
主要功能
- 01类型化集合与架构
- 02类 SQL 内容查询
- 03Markdown 与 MDC 渲染
- 04远程内容源
- 05数据库与 Studio 指南
适用场景
- 01定义内容集合
- 02查询内容与导航
- 03用 Vue 组件渲染 Markdown
- 04配置内容数据库
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ nuxt-content/ nuxt-studio --skill nuxt-content安装后在 Claude Code 中输入/nuxt-content确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
references/collections.mdconfig.mdquerying.mdrendering.mdstudio.md详细介绍
Nuxt Content v3
为内容驱动的 Nuxt 应用提供渐进式指导,支持类型化集合和由 SQL 支持的查询。
适用场景
适用于以下工作:
- 内容集合(
content.config.ts、defineCollection) - 远程来源(GitHub 仓库、通过
defineCollectionSource接入的外部 API) - 内容查询(
queryCollection、导航、搜索) - MDC 渲染(
<ContentRenderer>、prose 组件) - 数据库配置(SQLite、PostgreSQL、D1、LibSQL)
- 内容钩子(
content:file:beforeParse、content:file:afterParse) - i18n 多语言内容
- NuxtStudio 或预览模式
- 大模型集成(
nuxt-llms)
编写文档: 使用 document-writer 技能
Nuxt 基础知识: 使用 nuxt 技能
部署到 NuxtHub: 使用 nuxthub 技能(兼容 NuxtHub v1)
可用指南
根据当前工作阅读特定文件:
- references/collections.md - defineCollection、模式、来源、content.config.ts
- references/querying.md - queryCollection、导航、搜索、周边内容
- references/rendering.md - ContentRenderer、MDC 语法、prose 组件、Shiki
- references/config.md - 数据库设置、Markdown 插件、渲染器选项
- references/studio.md - NuxtStudio 集成、预览模式、实时编辑
使用模式
渐进式加载——只阅读所需内容:
- 设置集合?→ references/collections.md
- 查询内容?→ references/querying.md
- 渲染 Markdown/MDC?→ references/rendering.md
- 配置数据库/Markdown?→ references/config.md
- 使用 NuxtStudio?→ references/studio.md
不要一次性阅读所有文件。 根据上下文加载:
- 编辑
content.config.ts→ 阅读 collections.md - 使用
queryCollection()→ 阅读 querying.md - 使用
<ContentRenderer>或 MDC → 阅读 rendering.md - 配置数据库或 Markdown → 阅读 config.md
- 设置预览/studio → 阅读 studio.md
核心概念
| 概念 | 用途 |
|---|---|
| 集合 | 带有模式的类型化内容组 |
| 页面与数据 | page = 路由 + 正文,data = 仅结构化数据 |
| 远程来源 | GitHub 使用 source.repository,API 使用 defineCollectionSource |
| queryCollection | 类 SQL 的内容链式调用 API |
| MDC | Markdown 中的 Vue 组件 |
| ContentRenderer | 渲染解析后的 Markdown 正文 |
目录结构
project/
├── content/ # Content files
│ ├── blog/ # Maps to 'blog' collection
│ └── .navigation.yml # Navigation metadata
├── components/content/ # MDC components
└── content.config.ts # Collection definitions
官方文档
- Nuxt Content:https://content.nuxt.com
- MDC 语法:https://content.nuxt.com/docs/files/markdown#mdc-syntax
- 集合:https://content.nuxt.com/docs/collections/collections
Token 效率
主技能:约 300 个 token。每个子文件:约 800–1200 个 token。仅加载与当前任务相关的文件。
评论
支持 Markdown