↓ 跳过正文
tag — Starmap & Dust

Hugo

13 篇文章 · 持续更新中

Hugo 主题对比

Hugo 主题对比

·973 字·2 分钟
Hugo 主题对比分析 # 本文档记录了项目中各 Hugo 主题的版本兼容性和功能对比分析。 统计方法 # 1. Hugo 版本要求 # 从各主题的 theme.toml 文件中提取 min_version 字段:
Hugo 缓存问题

Hugo 缓存问题

·72 字·1 分钟
Hugo 缓存清理 # 禁用缓存重新运行 # rm -rf resources public && hugo server -D --disableFastRender --noHTTPCache 参数说明 # 参数/命令 作用 rm -rf resources public 删除缓存目录 --disableFastRender 禁用快速渲染,每次修改都完整重新构建 --noHTTPCache 禁用 HTTP 缓存
Firebase 集成指南

Firebase 集成指南

·1601 字·4 分钟
Firebase 配置指南 # 本指南帮助你配置 Firebase 以启用文章浏览数和点赞功能。Blowfish 主题已内置 Firebase 支持,使用 Firebase v9 ES modules 实现。
Blowfish 搜索功能

Blowfish 搜索功能

·770 字·2 分钟
Blowfish 搜索功能说明 # Blowfish 主题内置了基于 Fuse.js 的客户端搜索功能。 工作原理 # 1. 索引生成 # Hugo 通过配置生成搜索索引文件 index.json:
Blowfish 迁移记录

Blowfish 迁移记录

·364 字·1 分钟
Blowfish 迁移特性对比 # 特性 puppet_zd Blowfish 迁移注意 数学公式 ✅ ✅ 需配置 代码高亮 ✅ ✅ 需配置 Giscus 评论 ✅ ✅ 需迁移 社交链接 ✅ ✅ 需迁移 侧边栏 ✅ ❌ 无此功能 朋友链接 ✅ ⚠️ 需自定义页面 RSS ✅ ✅ 自动 搜索 ❓ ✅ 需启用 深色模式 ❓ ✅ 需配置 代码复制 ❓ ✅ enableCodeCopy 阅读时间 ❓ ✅ showReadingTime 目录 TOC ❓ ✅ showTableOfContents 分享按钮 ❓ ✅ sharingLinks 作者信息 ✅ ✅ Author 配置 自定义 CSS/JS ✅ ✅ 需迁移 当前关键配置 # Giscus # repo: zhenda-hub/zhenda-hub.github.io repo_id: R_kgDOKvQVww category: Announcements category_id: DIC_kwDOKvQVw84CfdFG input_position: top theme: light lang: en 社交 # github: zhenda-hub rss: true 朋友链接 # - John Doe (https://gohugo.io) - 梅塔沃克 (https://iweec.com/) Blowfish 配置文件结构 # config/_default/ ├── hugo.toml # baseURL, theme, outputs, taxonomies ├── params.toml # 主题参数 ├── languages.en.toml # 语言、作者信息 └── menus.en.toml # 导航菜单 必须配置的参数 # hugo.toml # theme = "blowfish" baseURL = "https://zhenda-hub.github.io/" outputs.home = ["HTML", "RSS", "JSON"] # 搜索必需 params.toml # enableSearch = true enableCodeCopy = true defaultAppearance = "light" autoSwitchAppearance = true [homepage] layout = "profile" showRecent = true showRecentItems = 999 cardView = true languages.en.toml # title = "Zhenda's Blog" [params.author] name = "Zhenda" image = "img/avatar.jpg" headline = "Stay hungry, stay humble, and keep shipping value." bio = "A personal website" links = [ { github = "https://github.com/zhenda-hub" }, { rss = "/index.xml" }, ] 缩略图方案 # 方案 A: Page Bundle - 放 feature* 图片在文章目录 方案 B: 暂时不处理 参考 # Getting Started Configuration Homepage Layout
Blowfish 配置指南

Blowfish 配置指南

·635 字·2 分钟
Blowfish 配置选项 # 配置项 当前值 可选值 说明 外观 colorScheme blowfish blowfish, avocado, fire, ocean, forest, neon, etc. 主题配色 defaultAppearance light light, dark 默认外观 autoSwitchAppearance true true, false 自动切换深浅色 导航栏 header.layout fixed basic, fixed, fixed-fill, fixed-fill-blur 导航栏样式 首页 homepage.layout profile profile, page, hero, card, background, custom 首页布局 homepage.showRecentItems 999 数字 显示文章数 homepage.cardView true true, false 卡片视图 文章 article.showHero false true, false 显示 Hero 图片 article.heroStyle - basic, big, background, thumbAndBackground Hero 样式 article.showBreadcrumbs false true, false 面包屑导航 article.sharingLinks - bluesky, email, facebook, linkedin, mastodon, etc. 分享按钮 列表页 list.showHero false true, false 列表 Hero 图片 list.showSummary false true, false 显示摘要 其他 footer.showAppearanceSwitcher false true, 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 主题根据文章开头格式自动生成摘要: 开头格式 摘要来源 示例 正文 + `