本页适用于 v2 的 _config.stellar.yml。主题默认配置列出了完整配置和默认值,校验规则说明了类型和取值限制。不同版本可能有差异,请以安装版本为准。

下表按用途列出配置项。第三方服务的完整参数以服务方说明为准;对象和数组的覆盖方式见行为参考

布局、Brand 与导航

字段类型与默认说明
topbar.enabledboolean,false顶部栏开关
leftbar.enabledrightbar.enabledboolean,true左右栏开关
leftbar.default_stateexpanded / collapsed,默认 expanded桌面初始状态
topbar.brandleftbar.brandobject / false固定 Brand;false 整体隐藏
Brand image.srcnametaglinestring / null,默认 null图片与纯文本身份信息;null 隐藏
Brand image.variantavatar / icon / plain,默认 avatar图片呈现方式
Brand hrefstring / null,默认 /安全导航链接
leftbar.brand.styleregular / compact,默认 regular视觉样式
topbar.menuleftbar.menuarray顶部默认空;左侧默认博客、分类、标签、专栏、归档、友链、关于及搜索
Menu 项objecttype(默认 link,可用 search);链接填写非空 kebab-case 的 idurl,可配 title/icon/accent;搜索项只需 type
topbar.widgetsleftbar.widgetsrightbar.widgetsarray,默认 []内容 Widget 列表;profile 可继续覆盖
leftbar.footer.actionsarray,默认 []操作项;类型为 link/button/dropdown/spacer
Action 项objecttype/icon/title/url/onclick/items;link 用 url,button 用 onclick,dropdown 用 items;子项为 link 或 button
footer.contentstring站点页脚 Markdown,默认主题署名;支持主题变量,空串隐藏
footer.sectionsarray,默认 []分栏项 title/items;子项 title/url

source/back_button/search 不属于主题固定 Brand 字段,见 Collection Brand

页面类型

profiles.<profile> 保存各类型的 Region 默认值及导航。Region 子字段沿用上表;省略继承,数组替换,允许的 null 表示继承。下表给出预设布局,实际内容还受可见性和上下文限制。

Profile用途/默认路径默认 Leftbar Widget默认 Rightbar Widget
home首页recent
blog_index博客列表,/blog/recent
post博客文章related、recentghrepo、toc
topic专栏,/topic/ 前缀related、recentghrepo、toc
wiki_indexWiki 列表,/wiki/related、recent
wikiWiki 页面tree、relatedghrepo、toc
notebook_index笔记本总列表,/notebooks/path: null 只关闭总列表recent
note_index笔记本列表与标签页tagtree、recent
note笔记详情tagtree、recenttoc
author作者页,/author/recent
page普通独立页面recenttoc
settings设置页,/settings/recent
error错误页,/404.htmlrecent

active_menu 为菜单 ID 或 null;默认 home、blog_index、post、topic、author、page、error 使用 post,其余 null。Wiki 默认清空固定菜单和底部操作。

path 用于表中支持自定义路径的页面类型;文章的永久链接使用 permalink,集合路径使用 route.pathwiki_index.path: null 停止生成 Wiki 列表;notebook_index.path: null 只停止生成笔记本总列表,各 Notebook 的集合、标签和详情路由仍会生成。

profiles.blog_index.listing_navprofiles.wiki_index.listing_nav 使用 enabled/tabs;默认分别 false/true,tabs 默认空,每项为 title/url

profiles.home.comments 使用 enabled/title/id/provider/options,默认关闭、其它字段 null、options 空对象。其覆盖语义同页面评论

文章、笔记与设置页

字段默认值可选值与用途
article.styletechtech / story
article.paragraph_indentautoauto / always / never
article.listing.pinned_layoutcarouselcarousel / flat
article.listing.card_layoutherohero / classic
article.listing.cover_ratio2正数
article.listing.excerpt_length128非负整数;0 禁用自动摘要
article.listing.show_tagsfalseboolean,卡片标签
article.category_colors内置“探索号”配色分类名到 CSS 颜色的映射
article.banner.ratio2.5正数
article.show_reading_timefalseboolean
article.related_posts_limit0非负整数;0 不显示相关文章
article.footer.license默认 CC BY-NC-SA 4.0 文案string / false
article.footer.share全部内置服务字符串数组,空数组隐藏
article.footer.show_tagstrueboolean,文章页标签
notebook.listing.per_pagenull非负整数或 null;0 不分页,null 继承 Hexo
notebook.listing.sort.fieldupdateddate / updated / title
notebook.listing.sort.directiondescasc / desc
notebook.listing.excerpt_length128非负整数
notebook.tag_icons{}标签到图标的映射
settings.about.itemsHexo 与主题版本数组,条目 key/value/url;value 与 url 支持主题变量

分享服务为 wechat/weibo/x/telegram/whatsapp/email/link/system。主题级 notebook 只配置列表与标签图标,不接受 footer;Wiki、Topic、Notebook 的内容页脚在 Collection 或 Front Matter 中配置,默认继承 Article 许可协议并关闭分享。页面作者和 AI 标记见 Front Matter,它们不是主题 article 的全局字段。

外观

字段默认/约束
appearance.presetcard;card / glass / minimal / flat
appearance.color_schemeauto;auto / light / dark
appearance.colors.primary/accent/linkCSS 颜色,具体值见默认配置
appearance.gradients.primary_action/search_barCSS 渐变,具体值见默认配置
appearance.typography.font_family.body/code字体列表;默认系统字体与 Menlo/Monaco/Consolas 等代码字体
appearance.typography.font_size.root/inline_code/code_blockCSS 长度,默认 16px / 85% / 0.8125rem
appearance.typography.content_alignleft;left / center / right / justify
appearance.typography.heading_prefixes.h2/h3/h4/h5字符串,默认分别为井号、等号、竖线、冒号
appearance.shape.cornersuperellipse(1.25);round / scoop / bevel / notch / square / superellipse(…)
appearance.shape.radius.card_large/card/card_small/barCSS 长度,默认 24px / 16px / 12px / 12px
appearance.shape.radius.image_large/image/image_smallCSS 长度,默认 24px / 16px / 8px
appearance.backgrounds.leftbar.typegradient;none / gradient / image
appearance.backgrounds.leftbar.image资源地址或 null,默认 null
appearance.backgrounds.leftbar.gradient.light/dark颜色数组,默认四种配色;整体替换
appearance.backgrounds.leftbar.opacity0–1,默认 1
appearance.backgrounds.leftbar.backdrop.radiusCSS 长度,默认 100px
appearance.backgrounds.page.image资源地址或 null,默认 null
appearance.backgrounds.page.backdrop.radius/overlay/saturation模糊、遮罩与饱和度,默认 100px / var(–bg-a75) / 300%
appearance.code_block.scrollbar_widthCSS 长度,默认 4px
appearance.code_block.highlight_stylesheet资源地址或 null,默认 Atom One Dark 样式表

搜索

字段默认/约束
search.providerlocal;local / algolia / null(关闭)
search.local.scopeall;索引范围 all / post / page
search.local.include_contenttrue,是否索引正文
search.local.cache_ttl_seconds86400,非负整数秒;0 不缓存
search.algolia参数对象;appId/apiKey/indexName 默认 null

评论

comments.provider 默认 null,可选 beaudar、utterances、giscus、twikoo、waline、artalk。comments.title 默认 null。各服务的参数填写在同名子对象中,并使用服务方原有的字段名;连接参数和操作步骤见评论指南。默认参数可查主题默认配置,账号信息和部署地址需要自行填写。

标签默认值

字段默认/约束
tags.note.default_color/border空字符串 / true
tags.checkbox.interactivefalse
tags.quot.<variant>.prefix/suffix图标 ID 或 null;内置 default、hashtag、question
tags.emoji.default_sourceblobcat,必须对应 sources 中的键
tags.emoji.sources地址模板映射,使用 {name};内置 twemoji、qq、aru、tieba、blobcat
tags.icon.default_coloraccent
tags.button.default_colortheme
tags.mark.default_coloryellow
tags.hashtag.default_colornull
tags.gallery.sizemix;s / m / l / xl / mix
tags.gallery.aspect_ratiosquare;original / square / portrait

语法见表达标签数据标签容器标签

浏览器功能

字段默认/约束
features.color_scheme_switch.enabledfalse
features.lazy_loading.transition/auto_aspect_ratiofade / true;transition 可选 blur/fade
features.lightbox.enabled/selectortrue / .timenode p>img
features.link_prefetch.enabledfeatures.reveal.enabledtrue
features.card_hover.enabledfeatures.heti.enabledfalse
features.math.providernull;katex / mathjax / null
features.math.katex/mathjax第三方参数对象,默认空对象
features.diagrams.providernull;mermaid / null
features.diagrams.mermaid.themeneutral;default / dark / forest / neutral

服务与资源

字段默认/约束
services.site_info.providersite_info_api / null
services.site_info.site_info_api.endpointSite Info 公共接口,支持 {href} 占位
services.rating.providerservices.vote.providerstar_vote / null
services.rating.star_vote.endpointservices.vote.star_vote.endpoint评分、投票公共接口
services.contributors.providergithub
services.contributors.github.repositories空数组;条目 source_prefix/repository/branch,branch 默认 main
services.github_card.providergithub_readme_stats
services.github_card.github_readme_stats.endpointGitHub Readme Stats 地址
services.github.api_url/raw_url/gist_urlGitHub 官方 API、Raw、Gist 完整 HTTP(S) 地址
preconnect空数组;资源 Origin 列表
fallbacks.avatar/link_card/cover非空资源地址,默认主题占位资源;用于对应的头像、链接卡片或 SEO 图片
error_page.image错误页插图资源地址,null 隐藏

默认 endpoint 的完整地址见默认配置。这些备用图片不适用于所有卡片或 Brand;缺图时的显示方式见行为参考

SEO 与可信注入

字段默认/约束
canonical.hostnull;主机名,null 不生成主题 canonical 并关闭主机检查
canonical.allowed_hosts[localhost],备用主机列表
open_graph.enabledtrue
open_graph.twitter_idnull 或字符串
structured_data.same_as空数组,外部身份 URL
inject.head_end/body_end空字符串,可信原始 HTML

配置文件使用本页列出的字段。主题源码中的运行时对象和 camelCase 属性不直接用于 _config.stellar.yml

站内搜索

没有找到内容!