Skip to main content
  1. Posts/

Blowfish 配置指南

·635 words·2 mins· loading · loading · ·
Author
Zhenda
A personal website
Hugo Blowfish 指南 - This article is part of a series.
Part : This Article

Blowfish 配置选项
#

配置项当前值可选值说明
外观
colorSchemeblowfishblowfish, avocado, fire, ocean, forest, neon, etc.主题配色
defaultAppearancelightlight, dark默认外观
autoSwitchAppearancetruetrue, false自动切换深浅色
导航栏
header.layoutfixedbasic, fixed, fixed-fill, fixed-fill-blur导航栏样式
首页
homepage.layoutprofileprofile, page, hero, card, background, custom首页布局
homepage.showRecentItems999数字显示文章数
homepage.cardViewtruetrue, false卡片视图
文章
article.showHerofalsetrue, false显示 Hero 图片
article.heroStyle-basic, big, background, thumbAndBackgroundHero 样式
article.showBreadcrumbsfalsetrue, false面包屑导航
article.sharingLinks-bluesky, email, facebook, linkedin, mastodon, etc.分享按钮
列表页
list.showHerofalsetrue, false列表 Hero 图片
list.showSummaryfalsetrue, false显示摘要
其他
footer.showAppearanceSwitcherfalsetrue, false底部外观切换
smartTOC-true, false智能 TOC 高亮

当前已启用的功能
#

  • ✅ 搜索 (enableSearch = true)
  • ✅ 代码复制 (enableCodeCopy = true)
  • ✅ 固定导航栏 (header.layout = "fixed")
  • ✅ 文章目录 (article.showTableOfContents = true)
  • ✅ 阅读时间 (article.showReadingTime = true)
  • ✅ 字数统计 (article.showWordCount = true)
  • ✅ 标题锚点 (article.showHeadingAnchors = true)
  • ✅ 分类标签 (article.showTaxonomies = true)
  • ❌ 按年份分组 (list.groupByYear = false)
  • ✅ 卡片视图 (list.cardView = true)
  • ⏸️ Giscus 评论(需要自定义 partial)
  • ⏸️ 文章缩略图(可选)
  • ⏸️ 面包屑导航

待配置功能
#

  • ⏸️ 作者头像(需要添加图片)
  • ⏸️ 分享按钮
  • ⏸️ Hero 图片

文章创建配置
#

修改 archetypes/default.md 可设置新文章的默认 front matter:

+++
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
subtitle = ""
date = {{ .Date }}
draft = false  # 默认发布状态
toc = true
series = []
+++

创建新文章时使用:

hugo new posts/my-new-article.md

文章摘要配置
#

Blowfish 主题根据文章开头格式自动生成摘要:

开头格式摘要来源示例
正文 + `

|前的内容 |这是摘要…## 正文| |# 一级标题+ 正文 | 一级标题后的正文 |# 标题\n这是摘要…| |[toc]/## 二级标题| ❌ 无摘要 |[toc]\n## 正文` |

添加摘要的方法:

方法 1:使用 <!--more--> 分隔符

+++
title = "文章标题"
+++

这是文章摘要,会显示在列表页...

<!--more-->

## 正文内容
正文开始...

方法 2:使用 summary 参数

+++
title = "文章标题"
summary = "这是自定义摘要"
+++
Hugo Blowfish 指南 - This article is part of a series.
Part : This Article