基本配置
站点基础信息和作者信息配置
基本配置 #
站点信息 #
基础配置 #
baseURL = 'https://yourdomain.com' # 站点地址
languageCode = 'zh-CN' # 语言代码
defaultContentLanguage = 'zh' # 默认语言
title = '我的博客' # 站点标题
theme = 'PrimeEdge' # 主题名称
作者信息 #
[params.author]
name = "你的名字" # 作者名称
bio = "一句话介绍自己" # 作者简介
avatar = "/images/avatar.jpg" # 头像路径
作者信息会显示在:
- 文章页面的作者栏
- 关于页面
- 部分页面的侧边栏
站点头部 #
[params.header]
logo = "" # Logo 图片路径(有值则显示图片)
title = "站点名称" # 导航栏文字(logo 为空时使用,留空显示站点标题)
显示优先级:Logo 图片 > 导航栏文字 > 站点标题
title 会显示在:
- 导航栏 Logo 位置(无 logo 图片时)
- 首页预加载动画
分页配置 #
[pagination]
pagerSize = 10 # 每页文章数量
分类和标签 #
[taxonomies]
category = 'categories' # 分类
tag = 'tags' # 标签
series = 'series' # 系列(可选)
输出格式 #
[outputs]
home = ['HTML', 'RSS', 'Search', 'FullRSS', 'Feed']
page = ['HTML'] # 页面输出格式
section = ['HTML', 'RSS'] # 章节输出格式
[outputFormats]
[outputFormats.Search]
mediaType = 'application/json'
baseName = 'search'
isPlainText = true
[outputFormats.FullRSS]
mediaType = 'application/rss+xml'
baseName = 'rss'
isPlainText = true
noUgly = true
[outputFormats.Feed]
mediaType = 'application/rss+xml'
baseName = 'feed'
isPlainText = true
noUgly = true
Search 输出会生成 /search.json,供站内搜索使用。FullRSS 和 Feed 分别生成 /rss.xml 与 /feed.xml。
图片处理 #
[imaging]
quality = 75 # 图片质量
resampleFilter = 'lanczos' # 重采样滤镜
安全设置 #
[security]
[security.funcs]
getenv = ['^HUGO_', '^CI$'] # 允许的环境变量
完整示例 #
baseURL = 'https://kok.plus'
languageCode = 'zh-CN'
defaultContentLanguage = 'zh'
title = 'KOK.PLUS'
theme = 'PrimeEdge'
[pagination]
pagerSize = 10
[taxonomies]
category = 'categories'
tag = 'tags'
[params]
[params.author]
name = "KOK"
bio = "Say what's on my mind, read books I enjoy"
avatar = "/images/tx.jpeg"
[params.header]
logo = ""
title = "KOK.PLUS"
[outputs]
home = ['HTML', 'RSS', 'Search', 'FullRSS', 'Feed']
page = ['HTML']
section = ['HTML', 'RSS']
[outputFormats]
[outputFormats.Search]
mediaType = 'application/json'
baseName = 'search'
isPlainText = true
[outputFormats.FullRSS]
mediaType = 'application/rss+xml'
baseName = 'rss'
isPlainText = true
noUgly = true
[outputFormats.Feed]
mediaType = 'application/rss+xml'
baseName = 'feed'
isPlainText = true
noUgly = true
[imaging]
quality = 75
resampleFilter = 'lanczos'
评论