Collection 文件位于 source/_data/wiki/source/_data/topic/source/_data/notebooks/。文件路径提供 profile,文件名提供 ID;name 是必填非空名称。只需填写当前集合要修改的配置,其余值由主题提供。

基本信息、路径与展示

字段类型/默认适用范围与行为
name非空 string,必填全部;集合名称
headline/tagline/description/audiencestring / null全部;标题、辅助文案、描述及受众
tagsstring array,省略为空全部;集合分类信息
icon/coverstring / null身份图标与集合列表封面
route.pathstring,省略由 profile 与 ID 派生集合路径,规范化为相对路径
route.startstring / null仅 Topic,入口文章
navigation.treearray / object仅 Wiki,页面键列表或分组树
listing.priority非负整数 / null仅 Wiki 集合;在支持置顶的列表中使用
listing.order非负整数 / nullWiki、Notebook;当前 Wiki 书架另按 shelf 顺序
listing.excerpt_length非负整数 / nullTopic、Notebook,0 关闭自动摘要
listing.per_page非负整数 / null仅 Notebook,0 不分页,null 继承 Hexo
listing.sort.field/directiondate/updated/title;asc/desc,可省略Topic、Notebook;默认分别 date desc、updated desc
visibility.listed/searchableboolean,默认 true全部;控制集合上架及成员的列表/搜索默认值,不删除路由

没有集合封面时不跨字段使用 icon 或横幅补齐;成员文章的根级 cover/tagline 也不继承集合对应字段。

Hero 与横幅

hero 仅用于 Wiki:

字段类型与用途
hero.enabledboolean / null,是否启用首页 Hero
hero.background.imagestring / null,背景图片
hero.background.effectobject / null;typeferrofluidgalaxylight-raysoptions 为对应效果参数
hero.background.effect.runtimepause_when_hidden/respect_reduced_motion 可选 boolean,均默认 true
hero.preview.typeterminal / image
hero.preview.src/alt图片地址与替代文字
hero.preview.commands数组,条目 label/codes
hero.actions数组,条目 title/url/icon

Wiki、Topic、Notebook 等集合都支持内容横幅 banner.enabled/image/avatar/headline/tagline,分别是 boolean/null 与 string/null。页面按字段覆盖集合横幅。Hero、集合封面、图标与内容横幅互不替代。

Hero 背景效果

hero.background.image 与动态效果可以同时配置:图片位于 Canvas 下方,动态效果加载失败时仍保留图片。没有图片时,Galaxy 和普通 Light Rays 使用黑色静态底色,Ferrofluid 使用其 backgroundColorlightMode: true 的 Light Rays 使用白色底色。Canvas 不接收指针事件,不会遮挡 Hero 中的链接和按钮。

Ferrofluid

blog/source/_data/wiki/handbook.yml
hero:
enabled: true
background:
effect:
type: ferrofluid
options:
colors: ['#ffffff', '#06B6D4', '#E0F2FE']
backgroundColor: '#03010A'
speed: 0.5
flowDirection: down
mouseInteraction: true
参数类型/默认用途
colors十六进制颜色数组,['#ffffff', '#ffffff', '#ffffff']按流体表面高度分配的颜色,支持 1–8 项;单色会统一整个效果
backgroundColor六位十六进制颜色,#03010A无背景图片时的静态底色与文字自适应取色基准
speednumber,0.5流体运动速度倍率
scalenumber,1.6整体特征尺寸;数值越大,显示的流体块越大、数量越少
turbulencenumber,1流动区域的扭曲程度
fluiditynumber,0.1两层流体之间的融合平滑度
rimWidthnumber,0.2发光轮廓宽度
sharpnessnumber,2.5轮廓高光对比度
shimmernumber,1.5轮廓颗粒与断裂强度;0 表示平滑线条
glownumber,2轮廓整体亮度倍率
flowDirectionstring,down主要流动方向:updownleftright
opacitynumber,1Canvas 输出透明度
mouseInteractionboolean,true是否响应鼠标并在指针附近产生磁性扰动
mouseStrengthnumber,1鼠标扰动强度
mouseRadiusnumber,0.35鼠标扰动的衰减半径
mouseDampeningnumber,0.15鼠标跟随缓动时间常数,单位为秒;0 表示立即跟随
pausedboolean,false是否绘制初始帧后停止 WebGL 更新
dprpositive number / null,nullCanvas 像素密度;null 或省略时使用设备 DPR
mixBlendModestring / null,null应用于 Canvas 的 CSS mix-blend-mode 值,例如 screenlighten

颜色可省略开头的 #;在 YAML 中使用带 # 的颜色时需要加引号。React 组件专用的 className 不属于主题配置。

Light Rays

blog/source/_data/wiki/handbook.yml
hero:
enabled: true
background:
effect:
type: light-rays
options:
raysOrigin: top-center
raysColor: '#00ffff'
raysSpeed: 1.5
lightSpread: 0.8
rayLength: 1.2
followMouse: true
mouseInfluence: 0.1
noiseAmount: 0.1
distortion: 0.05
参数类型/默认用途
raysOriginstring,top-center光源方向:top-lefttop-centertop-rightleftrightbottom-leftbottom-centerbottom-right
raysColor六位十六进制颜色,#ffffff光束颜色;# 可省略,在 YAML 中带 # 时需要加引号
raysSpeednumber,1光束变化速度
lightSpreadnumber,0.5光束扇面的扩散程度
rayLengthnumber,3光束延伸距离
pulsatingboolean,false是否加入周期性明暗脉冲
fadeDistancenumber,1光束随距离淡出的范围
saturationnumber,1光束颜色饱和度
followMouseboolean,true是否让光束方向跟随鼠标
mouseInfluencenumber,0.1鼠标对光束方向的影响强度
noiseAmountnumber,0光束中的噪声强度
distortionnumber,0光束路径的波动和扭曲强度
lightModeboolean,false使用适合浅色背景的深色光束表现

Galaxy

blog/source/_data/wiki/handbook.yml
hero:
enabled: true
background:
effect:
type: galaxy
options:
starSpeed: 2
hueShift: 140
mouseInteraction: true
参数类型/默认用途
focalnumber array,[0.5, 0.5]星河透视焦点
rotationnumber array,[1, 0]星河旋转向量
starSpeednumber,2星点纵深移动速度
densitynumber,2星点密度
hueShiftnumber,140色相偏移角度
disableAnimationboolean,false固定在初始画面
speednumber,0.5整体动画速度
mouseInteractionboolean,true是否响应鼠标移动
glowIntensitynumber,0.2星点辉光强度
saturationnumber,0.1星点颜色饱和度
mouseRepulsionboolean,true鼠标是否排斥附近星点
repulsionStrengthnumber,0.1鼠标排斥强度
twinkleIntensitynumber,0.1星点闪烁强度
rotationSpeednumber,0.1自动旋转速度
autoCenterRepulsionnumber,0中心自动排斥强度
transparentboolean,true是否使用透明 Canvas;false 时会覆盖背景图片

三种效果都支持运行时策略:

blog/source/_data/wiki/handbook.yml
hero:
background:
effect:
type: light-rays
runtime:
pause_when_hidden: true
respect_reduced_motion: true

pause_when_hidden 控制 Hero 离开视口或页面进入后台时是否暂停;respect_reduced_motion 控制系统请求减少动态效果时是否停止加载。两项默认都是 true。效果参数中的未知字段、错误类型、非法方向或颜色,以及 Ferrofluid 超过八项的颜色数组或非正数 DPR,都会在构建期报错。

Region 与 Brand

顶部栏、左侧栏、右侧栏(Region)使用 enabled/widgets,Topbar 和 Leftbar 还支持 brand/menu,Leftbar 支持 footer.actions。它们沿用主题结构,但作为局部覆盖:省略继承,数组整体替换,[] 清空。

Collection 的 leftbar.brand 额外支持 source: site/collectionback_buttonsearch。Wiki/Notebook 默认来源是 collection,Topic 默认 site;返回与集合搜索开关只在 collection 来源有效。style: regular/compact 与来源独立。Brand 整体可为 false 或 null;null 继承,false 隐藏。具体字段 null 隐藏对应内容。

成员默认值

配置域字段来源与默认
导航active_menubreadcrumb菜单 ID/null、boolean/null;导航按页面类型及集合上下文生成
排版article.style/paragraph_indent/author/ai_label继承主题排版;作者/AI 标记由集合或页面指定
页脚footer.references/license/share/show_tags许可协议和标签继承 Article;分享默认关闭;页面可覆盖
评论comments.enabled/title/id/provider/options继承全局服务,可按集合或页面替换
源码source.repository/branchstring/null;GitHub owner/repo 与分支
可见性visibility.listed/searchableCollection 值是成员默认;Page 可再覆盖

具体取值见 Front Matter,它与 Collection 共用这些内容覆盖结构。对象逐字段覆盖并不意味着所有 null 都有相同效果,详见行为规则

Wiki、Topic、Notebook Collection 的 footer.share 默认关闭。设置 true 会恢复全局 article.footer.share,数组显式选择服务,false[] 关闭;许可协议同样可用 true 恢复全局 Article 文案。Collection 的 visibility.listed: false 会隐藏集合总入口,并成为成员页的默认列表状态;searchable: false 成为成员页的默认搜索状态。页面可以显式改回 true,详情路由仍然生成。

各集合类型支持的功能

ProfileCollection 专属能力成员页面可置顶
WikiHero、目录树、listing.priority/order
Topicroute.start、listing.excerpt_length/sort
Notebooklisting.order/excerpt_length/per_page/sort

配置项需要符合所属集合类型。例如,Notebook 不能使用 Wiki 的 Hero;即使 YAML 格式正确,Doctor 和站点生成仍会报错。visibility 是三类 Collection 的共享字段;renderseoinject 只能写在页面中。

站内搜索

没有找到内容!