hugo-teek is loading...

配置说明

最后更新于:

⚙️ 配置说明

基础配置

编辑 hugo-teek-site/hugo.toml

 1baseURL = "https://yourdomain.com"
 2languageCode = "zh-CN"
 3title = "你的网站标题"
 4theme = "hugo-teek"
 5
 6[params]
 7  description = "网站描述"
 8  keywords = ["关键词1", "关键词2"]
 9
10  # 博主信息
11  [params.blogger]
12    avatar = "https://your-avatar-url.jpg"
13    name = "你的名字"
14    slogan = "你的签名"

菜单配置

 1# 一级菜单
 2[[menu.main]]
 3  name = "首页"
 4  url = "/"
 5  weight = 1
 6
 7# 带下拉的菜单
 8[[menu.main]]
 9  name = "文档"
10  url = "/docs/"
11  weight = 2
12  identifier = "docs"
13
14  # 子菜单
15  [[menu.main]]
16    name = "运维"
17    url = "/docs/linux/"
18    weight = 1
19    parent = "docs"

搜索配置 (Algolia)

1[params.algolia]
2  enabled = true
3  appId = "YOUR_APP_ID"
4  apiKey = "YOUR_SEARCH_API_KEY"
5  indexName = "YOUR_INDEX_NAME"

评论配置 (Twikoo)

1[params.comment]
2  enabled = true
3  provider = "twikoo"
4  envId = "https://your-twikoo-url.com/"
5  version = "1.6.41"

统计配置

 1[params.analytics]
 2  # 百度统计
 3  [params.analytics.baidu]
 4    id = "YOUR_BAIDU_ID"
 5
 6  # Google Analytics
 7  [params.analytics.google]
 8    id = "G-YOUR_GA_ID"
 9
10  # 不蒜子统计
11  [params.analytics.busuanzi]
12    enabled = true
13    url = "https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"

代码高亮配置

1[markup.highlight]
2  codeFences = true
3  guessSyntax = true
4  lineNos = true
5  lineNumbersInTable = true
6  noClasses = false
7  style = "monokai"  # 可选: monokai, github, dracula 等
8  tabWidth = 2

🎨 进阶使用

自定义首页 Hero

编辑 hugo-teek-site/data/heroBg.yaml 配置背景图:

1list:
2  - https://img1.example.com/bg1.jpg
3  - https://img2.example.com/bg2.jpg
4  - https://img3.example.com/bg3.jpg

配置副标题打字机效果(hugo.toml):

1[params.heroSubtitle]
2  typeSpeed = 90        # 打字速度(毫秒/字符)
3  deleteSpeed = 45      # 删除速度(毫秒/字符)
4  hold = 1800           # 保持时间(毫秒)
5  nextDelay = 600       # 下一句延迟(毫秒)
6  shuffle = false       # 是否随机顺序

自定义分类卡片

在首页显示分类卡片:

1[params.category]
2  enabled = true
3  limit = 8             # 显示卡片数量
4  autoPage = true       # 自动翻页
5  pageSpeed = 4000      # 翻页速度(毫秒)

添加友链

创建 content/about/friend-links.md

1---
2title: "友情链接"
3layout: "friends"
4---
5
6## 我的朋友们
7
8这里是我的友链列表...

data/friends.yaml 中配置友链:

1friends:
2  - name: "示例网站"
3    link: "https://example.com"
4    avatar: "https://example.com/avatar.jpg"
5    description: "这是一个示例网站"

多语言支持

编辑 hugo.toml 添加多语言配置:

 1[languages]
 2  [languages.zh-cn]
 3    languageName = "简体中文"
 4    weight = 1
 5
 6  [languages.en]
 7    languageName = "English"
 8    weight = 2
 9
10    [languages.en.params]
11      description = "English Description"

推荐使用微信支付
微信支付二维码
推荐使用支付宝
支付宝二维码
最新文章

文档导航