-
Notifications
You must be signed in to change notification settings - Fork 0
Writing Posts
Aafff623 edited this page Aug 8, 2026
·
2 revisions
文章进 Content Collections,不是随便丢 Markdown。
出厂长文(FM 全表、KaTeX/Mermaid/admonition/MDX):本地 docs/official/01-入门/编写文章.md。
下面只写 本站增量 与易踩坑;通用语法以官方篇为准。对照总表:Official-Docs-Map。
| 集合 | 路径 | 用途 |
|---|---|---|
posts |
src/content/posts/<slug>/ |
博客文章(md/mdx) |
_draftbox |
src/content/posts/_draftbox/<slug>/ |
本地草稿箱(gitignore,不 push) |
dynamic |
src/content/dynamic/ |
动态 / 碎碎念 |
spec |
src/content/spec/ |
About / Friends 等特殊页片段 |
脚手架:
pnpm new-post <slug>
pnpm new-d # 动态必填常见项:title、published。
常用可选:draft、tags、category、collections、pinned、password、comment 等。
以 src/content.config.ts schema 为准。
category 要用站点词表里的桶(如「指南」「前端开发」「Agentic Coding」等),不要凡 AI 相关就塞 Agentic Coding。新建分类先和站主确认。详见仓库 CONTEXT.md。
人工策展登记在 src/config/collectionsConfig.ts;文章 FM:
collections: [some-slug]支持一级 / 二级(parent)。总览页只展示一级;二级挂在一级详情下。
列表卡上的 emoji / 颜文字是展示层(title-mood),不要写进 frontmatter title。
草稿箱 _draftbox/
|
主题 demo draft: true
|
|
|---|---|---|
| Git | 忽略正文,不 push | 可入库 |
| 本地 |
pnpm dev 可打开 /posts/<slug>/
|
按主题规则藏生产列表 |
| 线上 | 远端无文件 → 构建无此文 | 随仓库走 |
| 出箱 | 迁到 posts/<slug>/,按需 draft: false
|
— |
箱内帖必须 draft: true。用户说「草稿 / 先本地调试」→ 进箱;说「可以发了」→ 出箱。
- 正文说明性冒号优先用全角
:(半角:偶发被当成 HTML 标签解析) - 附件卡语法:
::note{file="notes/xxx.md"}(文件在public/下)— 与 Docusaurus 的:::note不是同一套 - Mermaid / PlantUML / Wiki Link 等见
src/plugins/(功能 Wiki 页后续可拆)
按素材来源分支(细则在 AGENTS.md,此处不复制全文):
| 路径 | 源 | 技能链 |
|---|---|---|
| 甲 | 固定 Obsidian vault |
ob2blog → site-cascade
|
| 乙 | 会话 / 调研 |
knowledge-extract → knowledge-output → site-cascade
|
收尾级联会更新动态、统计、分类标签、热力图等。空壳脚手架 pnpm new-post 仍可用。