本文记录了对 Hugo 博客进行个性化配置的具体实现方法,包括网站名称、欢迎词和图标的修改。

需求清单

  1. 网站名称:从 “我的技术博客” 改为 “wuqq的Blog”
  2. 欢迎词:从 “Hi there 👋” 改为 “分享与反思 📝”
  3. 网站图标:添加一个适合的表情图标

实现方法

1. 修改配置文件

编辑根目录下的 hugo.toml 文件:

# 原配置
baseURL = 'https://wubajie.github.io/'
languageCode = 'zh-cn'
title = '我的技术博客'
theme = 'PaperMod'

[params]
[params.homeInfoParams]
Title = "Hi there 👋"
Content = "Welcome to my blog"

[[params.socialIcons]]
name = "github"
url = "https://github.com/"

[params.assets]
disableHLJS = true

[params.cover]
hidden = true
hiddenInList = true
hiddenInSingle = true

2. 更新配置内容

修改为以下内容:

# 新配置
baseURL = 'https://wubajie.github.io/'
languageCode = 'zh-cn'
title = 'wuqq的Blog'
theme = 'PaperMod'

[params]
[params.homeInfoParams]
Title = "分享与反思 📝"
Content = "记录技术学习与思考"

[[params.socialIcons]]
name = "github"
url = "https://github.com/Wubajie"

[params.assets]
disableHLJS = true
favicon = "https://emoji.gg/assets/emoji/4647_thinking-face.png"

[params.cover]
hidden = true
hiddenInList = true
hiddenInSingle = true

3. 配置说明

配置项说明
title网站名称wuqq的Blog
params.homeInfoParams.Title欢迎词标题分享与反思 📝
params.homeInfoParams.Content欢迎词内容记录技术学习与思考
params.assets.favicon网站图标https://emoji.gg/assets/emoji/4647_thinking-face.png
params.socialIcons[0].urlGitHub链接https://github.com/Wubajie

4. 构建与部署

执行以下命令构建并部署:

# 进入博客目录
cd /Users/wsq/Documents/blog_wqq/my-tech-blog

# 构建网站
hugo

# 进入构建目录
cd public

# 提交更改
git add .
git commit -m "更新网站设置:网站名称、欢迎词和图标"

# 推送部署
git push -f origin main

5. 验证结果

部署完成后,访问 https://wubajie.github.io/ 查看效果:

  • 网站标题已更新为 “wuqq的Blog”
  • 首页显示 “分享与反思 📝” 和 “记录技术学习与思考”
  • 浏览器标签页显示思考表情图标
  • GitHub 图标链接指向正确的个人主页

技术要点

  1. 配置文件位置hugo.toml 是 Hugo 网站的核心配置文件
  2. 主题参数:PaperMod 主题使用 [params] 部分进行配置
  3. 图标设置:使用 favicon 参数设置网站图标,可以使用外部图片 URL
  4. 部署流程:Hugo 构建静态文件后,需要通过 Git 推送至 GitHub Pages

后续建议

  • 可以根据个人喜好更换不同的图标
  • 欢迎词和副标题可以随时调整以反映个人风格
  • 建议定期备份配置文件,以便后续修改或迁移

完成时间:2026-03-07