版本范围:以
2.0.0-rc.5为发布基线,并核对截至 2026-09-18 的 main 源码(5c6c7a7c)。标注「main 开发版」的能力尚不包含在 rc.5 中;升级差异见版本记录。
Collection 文件位于 source/_data/wiki/、source/_data/topic/ 或 source/_data/notebooks/。文件路径提供 profile,文件名提供 ID;name 是显示名称;省略时使用 Collection ID 并给出 warning。只需填写当前集合要修改的配置,其余值由主题提供。
基本信息、路径与展示
| 字段 | 类型/默认 | 适用范围与行为 |
|---|---|---|
name | 非空 string,可省略 | 全部;集合名称 |
headline/tagline/description/audience | string / null | 全部;标题、辅助文案、描述及受众 |
tags | string array,省略为空 | 全部;集合分类信息 |
icon/cover | string / null | 身份图标与集合列表封面 |
route.path | string,省略由 profile 与 ID 派生 | 集合路径,规范化为相对路径 |
route.start | string / null | 仅 Topic,入口文章 |
navigation.tree | array / object | 仅 Wiki,页面键列表或分组树 |
listing.priority | 非负整数 / null | 仅 Wiki 集合;在支持置顶的列表中使用 |
listing.order | 非负整数 / null | Wiki、Notebook;当前 Wiki 书架另按 shelf 顺序 |
listing.excerpt_length | 非负整数 / null | Topic、Notebook,0 关闭自动摘要 |
listing.per_page | 非负整数 / null | 仅 Notebook,0 不分页,null 继承 Hexo |
listing.sort.field/direction | date/updated/title;asc/desc,可省略 | Topic、Notebook;默认分别 date desc、updated desc |
visibility.listed/searchable | boolean,默认 true | 全部;控制集合上架及成员的列表/搜索默认值,不删除路由 |
没有集合封面时不跨字段使用 icon 或横幅补齐;成员文章的根级 cover/tagline 也不继承集合对应字段。
Hero 与横幅
hero 仅用于 Wiki:
| 字段 | 类型与用途 |
|---|---|
hero.enabled | boolean / null,是否启用首页 Hero |
hero.background.image | string / null,背景图片 |
hero.background.video | main 开发版;string / null,背景视频地址;优先于 effect,image 用作 poster 与底图 |
hero.background.parallax | main 开发版;number,默认 0.2,范围 0–1;0 关闭视差位移 |
hero.background.effect | object / null;type 为 ferrofluid、galaxy、light-rays,main 开发版另支持 strands,options 为对应效果参数 |
hero.background.effect.runtime | pause_when_hidden/respect_reduced_motion 可选 boolean,均默认 true |
hero.preview.type | terminal / image |
hero.preview.src/alt | 图片地址与替代文字 |
hero.preview.commands | 数组,条目 label/codes |
hero.actions | 数组,条目 title/url/icon |
Collection 不配置 banner。成员页面用自己的 cover 提供内容横幅图片,用 Front Matter banner.enabled/avatar/headline/tagline 控制横幅内容;集合 cover 不继承到成员。Hero 背景单独使用 hero.background。
视频与滚动视差(main 开发版)
hero: |
video 接受站点资源路径或完整 URL,以静音、循环、自动播放和行内播放方式显示;自动播放仍受浏览器策略约束。设置视频后不加载 effect,image 同时作为视频 poster 和背景底图。静态图片、视频和动态效果都支持 parallax,默认 0.2,范围 0–1;设为 0 或系统启用减少动态效果时关闭位移。视频与未叠加动态效果的图片在 Hero 滚出视口时仍会渐隐,parallax: 0 不关闭该渐隐。
Hero 背景效果
hero.background.image 与动态效果可以同时配置:图片位于 Canvas 下方,动态效果加载失败时仍保留图片。没有图片时,Strands、Galaxy 和普通 Light Rays 使用黑色静态底色,Ferrofluid 使用其 backgroundColor;lightMode: true 的 Light Rays 使用白色底色。Canvas 不接收指针事件,不会遮挡 Hero 中的链接和按钮。
Strands(main 开发版)
流动的发光丝带,可叠加玻璃折射效果。需要浏览器支持 WebGL 2;无背景图片时使用黑色底色。
hero: |
| 参数 | 类型/默认 | 用途与边界 |
|---|---|---|
colors | 颜色数组,['#F97316', '#7C3AED', '#06B6D4'] | 0–8 个六位十六进制颜色;# 可省略,空数组使用程序生成的配色 |
count | number,3 | 丝带数量;运行时四舍五入并限制到 1–12 |
speed | number,0.5 | 动画速度;可为负数以反向播放 |
amplitude | number,1 | 摆动幅度 |
waviness | number,1 | 波动程度 |
thickness | number,0.7 | 丝带粗细 |
glow | number,2.6 | 辉光强度 |
taper | number,3 | 丝带收尖程度 |
spread | number,1 | 丝带分散程度 |
hueShift | number,0 | 色相偏移 |
intensity | number,0.6 | 发光亮度 |
saturation | number,1.5 | 色彩饱和度 |
opacity | number,1 | 输出透明度,运行时限制到 0–1 |
scale | number,1.5 | 整体缩放 |
glass | boolean,false | 启用玻璃效果 |
refraction | number,1 | 玻璃折射强度,仅 glass 开启时生效 |
dispersion | number,1 | 玻璃色散强度,仅 glass 开启时生效 |
glassSize | number,1 | 玻璃区域尺寸,仅 glass 开启时生效 |
数字参数在 Schema 中要求有限数值;运行时将 amplitude、waviness、glow、taper、spread、intensity、saturation 的负值按 0 处理,thickness、scale 最小为 0.0001;玻璃半径按 max(0.0001, 0.46 × glassSize) 计算。未知参数和不合法颜色不属于支持配置。
Ferrofluid
hero: |
| 参数 | 类型/默认 | 用途 |
|---|---|---|
colors | 十六进制颜色数组,['#ffffff', '#ffffff', '#ffffff'] | 按流体表面高度分配的颜色,支持 1–8 项;单色会统一整个效果 |
backgroundColor | 六位十六进制颜色,#03010A | 无背景图片时的静态底色与文字自适应取色基准 |
speed | number,0.5 | 流体运动速度倍率 |
scale | number,1.6 | 整体特征尺寸;数值越大,显示的流体块越大、数量越少 |
turbulence | number,1 | 流动区域的扭曲程度 |
fluidity | number,0.1 | 两层流体之间的融合平滑度 |
rimWidth | number,0.2 | 发光轮廓宽度 |
sharpness | number,2.5 | 轮廓高光对比度 |
shimmer | number,1.5 | 轮廓颗粒与断裂强度;0 表示平滑线条 |
glow | number,2 | 轮廓整体亮度倍率 |
flowDirection | string,down | 主要流动方向:up、down、left、right |
opacity | number,1 | Canvas 输出透明度 |
mouseInteraction | boolean,true | 是否响应鼠标并在指针附近产生磁性扰动 |
mouseStrength | number,1 | 鼠标扰动强度 |
mouseRadius | number,0.35 | 鼠标扰动的衰减半径 |
mouseDampening | number,0.15 | 鼠标跟随缓动时间常数,单位为秒;0 表示立即跟随 |
paused | boolean,false | 是否绘制初始帧后停止 WebGL 更新 |
dpr | positive number / null,null | Canvas 像素密度;null 或省略时使用设备 DPR |
mixBlendMode | string / null,null | 应用于 Canvas 的 CSS mix-blend-mode 值,例如 screen 或 lighten |
颜色可省略开头的 #;在 YAML 中使用带 # 的颜色时需要加引号。React 组件专用的 className 不属于主题配置。
Light Rays
hero: |
| 参数 | 类型/默认 | 用途 |
|---|---|---|
raysOrigin | string,top-center | 光源方向:top-left、top-center、top-right、left、right、bottom-left、bottom-center、bottom-right |
raysColor | 六位十六进制颜色,#ffffff | 光束颜色;# 可省略,在 YAML 中带 # 时需要加引号 |
raysSpeed | number,1 | 光束变化速度 |
lightSpread | number,0.5 | 光束扇面的扩散程度 |
rayLength | number,3 | 光束延伸距离 |
pulsating | boolean,false | 是否加入周期性明暗脉冲 |
fadeDistance | number,1 | 光束随距离淡出的范围 |
saturation | number,1 | 光束颜色饱和度 |
followMouse | boolean,true | 是否让光束方向跟随鼠标 |
mouseInfluence | number,0.1 | 鼠标对光束方向的影响强度 |
noiseAmount | number,0 | 光束中的噪声强度 |
distortion | number,0 | 光束路径的波动和扭曲强度 |
lightMode | boolean,false | 使用适合浅色背景的深色光束表现 |
Galaxy
hero: |
| 参数 | 类型/默认 | 用途 |
|---|---|---|
focal | number array,[0.5, 0.5] | 星河透视焦点 |
rotation | number array,[1, 0] | 星河旋转向量 |
starSpeed | number,2 | 星点纵深移动速度 |
density | number,2 | 星点密度 |
hueShift | number,140 | 色相偏移角度 |
disableAnimation | boolean,false | 固定在初始画面 |
speed | number,0.5 | 整体动画速度 |
mouseInteraction | boolean,true | 是否响应鼠标移动 |
glowIntensity | number,0.2 | 星点辉光强度 |
saturation | number,0.1 | 星点颜色饱和度 |
mouseRepulsion | boolean,true | 鼠标是否排斥附近星点 |
repulsionStrength | number,0.1 | 鼠标排斥强度 |
twinkleIntensity | number,0.1 | 星点闪烁强度 |
rotationSpeed | number,0.1 | 自动旋转速度 |
autoCenterRepulsion | number,0 | 中心自动排斥强度 |
transparent | boolean,true | 是否使用透明 Canvas;false 时会覆盖背景图片 |
所有内置效果都支持运行时策略:
hero: |
pause_when_hidden 控制 Hero 离开视口或页面进入后台时是否暂停;respect_reduced_motion 控制系统请求减少动态效果时是否停止加载。两项默认都是 true。效果参数中的未知字段、错误类型、非法方向或颜色,以及 Ferrofluid 超过八项的颜色数组或非正数 DPR,都会在构建期报错。
Region 与 Brand
顶部栏、左侧栏、右侧栏(Region)使用 enabled/widgets,Topbar 和 Leftbar 还支持 brand/menu,Leftbar 支持 footer.actions,main 开发版另支持 menu_columns(1–5 的整数,null 继承)。它们沿用主题结构,但作为局部覆盖:省略继承,数组整体替换,[] 清空。
Collection 的 leftbar.brand 额外支持 source: site/collection、back_button。Wiki/Notebook 默认来源是 collection,Topic 默认 site;返回开关只在 collection 来源有效;search、ghrepo、ghuser 沿用共享 Leftbar Brand 字段,搜索适用于两种来源。style: regular/compact 与来源独立。Brand 整体可为 false 或 null;null 继承,false 隐藏。具体字段 null 隐藏对应内容。
成员默认值
| 配置域 | 字段 | 来源与默认 |
|---|---|---|
| 导航 | active_menu、breadcrumb | 菜单 ID/null、boolean/null;导航按页面类型及集合上下文生成 |
| 排版 | article.style/paragraph_indent/author/ai_label | 继承主题排版;作者/AI 标记由集合或页面指定 |
| 页脚 | footer.references/license/share/show_tags | 许可协议和标签继承 Article;Topic 继承分享,Wiki/Notebook 关闭;页面可覆盖 |
| 评论 | comments.enabled/title/id/provider/options | 继承全局服务,可按集合或页面替换 |
| 源码 | source.repository/branch | string/null;GitHub owner/repo 与分支 |
| 可见性 | visibility.listed/searchable | Collection 值是成员默认;Page 可再覆盖 |
具体取值见 Front Matter,它与 Collection 共用这些内容覆盖结构。对象逐字段覆盖并不意味着所有 null 都有相同效果,详见行为规则。
Wiki、Notebook Collection 的 footer.share 默认关闭,Topic 默认继承全局 Article 分享。设置 true 会恢复全局 article.footer.share,数组显式选择服务,false 或 [] 关闭;许可协议同样可用 true 恢复全局 Article 文案。Collection 的 visibility.listed: false 会隐藏集合总入口,并成为成员页的默认列表状态;searchable: false 成为成员页的默认搜索状态。页面可以显式改回 true,详情路由仍然生成。
各集合类型支持的功能
| Profile | Collection 专属能力 | 成员页面可置顶 |
|---|---|---|
| Wiki | Hero、目录树、listing.priority/order | 否 |
| Topic | route.start、listing.excerpt_length/sort | 是 |
| Notebook | listing.order/excerpt_length/per_page/sort | 是 |
配置项需要符合所属集合类型。例如,Notebook 不能使用 Wiki 的 Hero;即使 YAML 格式正确,Doctor 和站点生成仍会报错。visibility 是三类 Collection 的共享字段;render、seo、inject 只能写在页面中。