chore(docs): refactor config docs

Signed-off-by: Dillon <dillonzq@outlook.com>
This commit is contained in:
Dillon 2022-05-10 23:48:28 +08:00
parent 8d031cf268
commit edb5533782
4 changed files with 122 additions and 113 deletions

View file

@ -4,14 +4,16 @@
min = "0.62.0" min = "0.62.0"
[params] [params]
# site default theme ("auto", "light", "dark") # site default theme ["auto", "light", "dark"]
# 网站默认主题 ("auto", "light", "dark") # 网站默认主题 ["auto", "light", "dark"]
defaultTheme = "auto" defaultTheme = "auto"
# public git repo url only then enableGitInfo is true # public git repo url only then enableGitInfo is true
# 公共 git 仓库路径,仅在 enableGitInfo 设为 true 时有效 # 公共 git 仓库路径,仅在 enableGitInfo 设为 true 时有效
gitRepo = "" gitRepo = ""
# which hash function used for SRI, when empty, no SRI is used ("sha256", "sha384", "sha512", "md5") # which hash function used for SRI, when empty, no SRI is used
# 哪种哈希函数用来 SRI, 为空时表示不使用 SRI ("sha256", "sha384", "sha512", "md5") # ["sha256", "sha384", "sha512", "md5"]
# 哪种哈希函数用来 SRI, 为空时表示不使用 SRI
# ["sha256", "sha384", "sha512", "md5"]
fingerprint = "" fingerprint = ""
# date format # date format
# 日期格式 # 日期格式
@ -29,11 +31,11 @@
# Header config # Header config
# 页面头部导航栏配置 # 页面头部导航栏配置
[params.header] [params.header]
# desktop header mode ("fixed", "normal", "auto") # desktop header mode ["fixed", "normal", "auto"]
# 桌面端导航栏模式 ("fixed", "normal", "auto") # 桌面端导航栏模式 ["fixed", "normal", "auto"]
desktopMode = "fixed" desktopMode = "fixed"
# mobile header mode ("fixed", "normal", "auto") # mobile header mode ["fixed", "normal", "auto"]
# 移动端导航栏模式 ("fixed", "normal", "auto") # 移动端导航栏模式 ["fixed", "normal", "auto"]
mobileMode = "auto" mobileMode = "auto"
# Header title config # Header title config
# 页面头部导航栏标题配置 # 页面头部导航栏标题配置
@ -132,8 +134,8 @@
# 搜索配置 # 搜索配置
[params.search] [params.search]
enable = false enable = false
# type of search engine ("lunr", "algolia") # type of search engine ["lunr", "algolia"]
# 搜索引擎的类型 ("lunr", "algolia") # 搜索引擎的类型 ["lunr", "algolia"]
type = "lunr" type = "lunr"
# max index length of the chunked content # max index length of the chunked content
# 文章内容最长索引长度 # 文章内容最长索引长度
@ -420,12 +422,12 @@
enableQQ = false enableQQ = false
serverURLs = "" serverURLs = ""
# emoji data file name, default is "google.yml" # emoji data file name, default is "google.yml"
# ("apple.yml", "google.yml", "facebook.yml", "twitter.yml") # ["apple.yml", "google.yml", "facebook.yml", "twitter.yml"]
# located in "themes/LoveIt/assets/data/emoji/" directory # located in "themes/LoveIt/assets/data/emoji/" directory
# you can store your own data files in the same path under your project: # you can store your own data files in the same path under your project:
# "assets/data/emoji/" # "assets/data/emoji/"
# emoji 数据文件名称, 默认是 "google.yml" # emoji 数据文件名称, 默认是 "google.yml"
# ("apple.yml", "google.yml", "facebook.yml", "twitter.yml") # ["apple.yml", "google.yml", "facebook.yml", "twitter.yml"]
# 位于 "themes/LoveIt/assets/data/emoji/" 目录 # 位于 "themes/LoveIt/assets/data/emoji/" 目录
# 可以在你的项目下相同路径存放你自己的数据文件: # 可以在你的项目下相同路径存放你自己的数据文件:
# "assets/data/emoji/" # "assets/data/emoji/"
@ -555,12 +557,12 @@
# 第三方库文件的 CDN 设置 # 第三方库文件的 CDN 设置
[params.cdn] [params.cdn]
# CDN data file name, disabled by default # CDN data file name, disabled by default
# ("jsdelivr.yml") # ["jsdelivr.yml"]
# located in "themes/LoveIt/assets/data/cdn/" directory # located in "themes/LoveIt/assets/data/cdn/" directory
# you can store your own data files in the same path under your project: # you can store your own data files in the same path under your project:
# "assets/data/cdn/" # "assets/data/cdn/"
# CDN 数据文件名称, 默认不启用 # CDN 数据文件名称, 默认不启用
# ("jsdelivr.yml") # ["jsdelivr.yml"]
# 位于 "themes/LoveIt/assets/data/cdn/" 目录 # 位于 "themes/LoveIt/assets/data/cdn/" 目录
# 可以在你的项目下相同路径存放你自己的数据文件: # 可以在你的项目下相同路径存放你自己的数据文件:
# "assets/data/cdn/" # "assets/data/cdn/"

View file

@ -1,7 +1,5 @@
baseURL = "https://example.com" baseURL = "https://example.com"
# determines default content language [en, zh-cn, fr, pl, ...]
# 设置默认的语言 [en, zh-cn, fr, pl, ...]
defaultContentLanguage = "en"
# theme # theme
# 主题 # 主题
theme = "LoveIt" theme = "LoveIt"
@ -13,20 +11,27 @@ themesDir = "../.."
# 网站标题 # 网站标题
title = "LoveIt" title = "LoveIt"
# language code [en, zh-CN, fr, pl, ...] # determines default content language ["en", "zh-cn", "fr", "pl", ...]
# 网站语言, 仅在这里 CN 大写 [en, zh-CN, fr, pl, ...] # 设置默认的语言 ["en", "zh-cn", "fr", "pl", ...]
defaultContentLanguage = "en"
# language code ["en", "zh-CN", "fr", "pl", ...]
# 网站语言, 仅在这里 CN 大写 ["en", "zh-CN", "fr", "pl", ...]
languageCode = "en" languageCode = "en"
# language name [English, 简体中文, Français, Polski, ...] # language name ["English", "简体中文", "Français", "Polski", ...]
# 语言名称 [English, 简体中文, Français, Polski, ...] # 语言名称 ["English", "简体中文", "Français", "Polski", ...]
languageName = "English" languageName = "English"
# whether to include Chinese/Japanese/Korean # whether to include Chinese/Japanese/Korean
# 是否包括中日韩文字 # 是否包括中日韩文字
hasCJKLanguage = false hasCJKLanguage = false
# default amount of posts in each pages # default amount of posts in each pages
# 默认每页列表显示的文章数目
paginate = 12 paginate = 12
# [UA-XXXXXXXX-X] google analytics code # google analytics code [UA-XXXXXXXX-X]
# 谷歌分析代号 [UA-XXXXXXXX-X]
googleAnalytics = "" googleAnalytics = ""
# copyright description used only for seo schema # copyright description used only for seo schema
# 版权描述,仅仅用于 SEO
copyright = "" copyright = ""
# whether to use robots.txt # whether to use robots.txt
@ -81,14 +86,16 @@ enableEmoji = true
title = "" title = ""
[params] [params]
# site default theme ("auto", "light", "dark") # site default theme ["auto", "light", "dark"]
# 网站默认主题 ("auto", "light", "dark") # 网站默认主题 ["auto", "light", "dark"]
defaultTheme = "auto" defaultTheme = "auto"
# public git repo url only then enableGitInfo is true # public git repo url only then enableGitInfo is true
# 公共 git 仓库路径,仅在 enableGitInfo 设为 true 时有效 # 公共 git 仓库路径,仅在 enableGitInfo 设为 true 时有效
gitRepo = "https://github.com/dillonzq/LoveIt" gitRepo = "https://github.com/dillonzq/LoveIt"
# which hash function used for SRI, when empty, no SRI is used ("sha256", "sha384", "sha512", "md5") # which hash function used for SRI, when empty, no SRI is used
# 哪种哈希函数用来 SRI, 为空时表示不使用 SRI ("sha256", "sha384", "sha512", "md5") # ["sha256", "sha384", "sha512", "md5"]
# 哪种哈希函数用来 SRI, 为空时表示不使用 SRI
# ["sha256", "sha384", "sha512", "md5"]
fingerprint = "" fingerprint = ""
# date format # date format
# 日期格式 # 日期格式
@ -106,11 +113,11 @@ enableEmoji = true
# Header config # Header config
# 页面头部导航栏配置 # 页面头部导航栏配置
[params.header] [params.header]
# desktop header mode ("fixed", "normal", "auto") # desktop header mode ["fixed", "normal", "auto"]
# 桌面端导航栏模式 ("fixed", "normal", "auto") # 桌面端导航栏模式 ["fixed", "normal", "auto"]
desktopMode = "fixed" desktopMode = "fixed"
# mobile header mode ("fixed", "normal", "auto") # mobile header mode ["fixed", "normal", "auto"]
# 移动端导航栏模式 ("fixed", "normal", "auto") # 移动端导航栏模式 ["fixed", "normal", "auto"]
mobileMode = "auto" mobileMode = "auto"
# Header title config # Header title config
# 页面头部导航栏标题配置 # 页面头部导航栏标题配置
@ -209,8 +216,8 @@ enableEmoji = true
# 搜索配置 # 搜索配置
[params.search] [params.search]
enable = true enable = true
# type of search engine ("lunr", "algolia") # type of search engine ["lunr", "algolia"]
# 搜索引擎的类型 ("lunr", "algolia") # 搜索引擎的类型 ["lunr", "algolia"]
type = "algolia" type = "algolia"
# max index length of the chunked content # max index length of the chunked content
# 文章内容最长索引长度 # 文章内容最长索引长度
@ -497,12 +504,12 @@ enableEmoji = true
enableQQ = false enableQQ = false
serverURLs = "https://leancloud.hugoloveit.com" serverURLs = "https://leancloud.hugoloveit.com"
# emoji data file name, default is "google.yml" # emoji data file name, default is "google.yml"
# ("apple.yml", "google.yml", "facebook.yml", "twitter.yml") # ["apple.yml", "google.yml", "facebook.yml", "twitter.yml"]
# located in "themes/LoveIt/assets/data/emoji/" directory # located in "themes/LoveIt/assets/data/emoji/" directory
# you can store your own data files in the same path under your project: # you can store your own data files in the same path under your project:
# "assets/data/emoji/" # "assets/data/emoji/"
# emoji 数据文件名称, 默认是 "google.yml" # emoji 数据文件名称, 默认是 "google.yml"
# ("apple.yml", "google.yml", "facebook.yml", "twitter.yml") # ["apple.yml", "google.yml", "facebook.yml", "twitter.yml"]
# 位于 "themes/LoveIt/assets/data/emoji/" 目录 # 位于 "themes/LoveIt/assets/data/emoji/" 目录
# 可以在你的项目下相同路径存放你自己的数据文件: # 可以在你的项目下相同路径存放你自己的数据文件:
# "assets/data/emoji/" # "assets/data/emoji/"
@ -632,12 +639,12 @@ enableEmoji = true
# 第三方库文件的 CDN 设置 # 第三方库文件的 CDN 设置
[params.cdn] [params.cdn]
# CDN data file name, disabled by default # CDN data file name, disabled by default
# ("jsdelivr.yml") # ["jsdelivr.yml"]
# located in "themes/LoveIt/assets/data/cdn/" directory # located in "themes/LoveIt/assets/data/cdn/" directory
# you can store your own data files in the same path under your project: # you can store your own data files in the same path under your project:
# "assets/data/cdn/" # "assets/data/cdn/"
# CDN 数据文件名称, 默认不启用 # CDN 数据文件名称, 默认不启用
# ("jsdelivr.yml") # ["jsdelivr.yml"]
# 位于 "themes/LoveIt/assets/data/cdn/" 目录 # 位于 "themes/LoveIt/assets/data/cdn/" 目录
# 可以在你的项目下相同路径存放你自己的数据文件: # 可以在你的项目下相同路径存放你自己的数据文件:
# "assets/data/cdn/" # "assets/data/cdn/"
@ -734,6 +741,8 @@ enableEmoji = true
taxonomy = ["HTML", "RSS"] taxonomy = ["HTML", "RSS"]
taxonomyTerm = ["HTML"] taxonomyTerm = ["HTML"]
# Multilingual
# 多语言
[languages] [languages]
[languages.en] [languages.en]
weight = 1 weight = 1
@ -815,7 +824,6 @@ enableEmoji = true
typeit = true typeit = true
social = true social = true
disclaimer = "" disclaimer = ""
# Social config in home page
[languages.en.params.social] [languages.en.params.social]
GitHub = "xxxx" GitHub = "xxxx"
Twitter = "xxxx" Twitter = "xxxx"

View file

@ -77,17 +77,28 @@ The following is a basic configuration for the LoveIt theme:
```toml ```toml
baseURL = "http://example.org/" baseURL = "http://example.org/"
# [en, zh-cn, fr, ...] determines default content language
defaultContentLanguage = "en"
# language code
languageCode = "en"
title = "My New Hugo Site"
# Change the default theme to be use when building the site with Hugo # Change the default theme to be use when building the site with Hugo
theme = "LoveIt" theme = "LoveIt"
# website title
title = "My New Hugo Site"
# language code ["en", "zh-CN", "fr", "pl", ...]
languageCode = "en"
# language name ["English", "简体中文", "Français", "Polski", ...]
languageName = "English"
# Author config
[author]
name = "xxxx"
email = ""
link = ""
# Menu config
[menu] [menu]
[[menu.main]] [[menu.main]]
weight = 1
identifier = "posts" identifier = "posts"
# you can add extra information before the name (HTML format is supported), such as icons # you can add extra information before the name (HTML format is supported), such as icons
pre = "" pre = ""
@ -97,23 +108,22 @@ theme = "LoveIt"
url = "/posts/" url = "/posts/"
# title will be shown when you hover on this menu link # title will be shown when you hover on this menu link
title = "" title = ""
weight = 1
[[menu.main]] [[menu.main]]
weight = 2
identifier = "tags" identifier = "tags"
pre = "" pre = ""
post = "" post = ""
name = "Tags" name = "Tags"
url = "/tags/" url = "/tags/"
title = "" title = ""
weight = 2
[[menu.main]] [[menu.main]]
weight = 3
identifier = "categories" identifier = "categories"
pre = "" pre = ""
post = "" post = ""
name = "Categories" name = "Categories"
url = "/categories/" url = "/categories/"
title = "" title = ""
weight = 3
# Markup related configuration in Hugo # Markup related configuration in Hugo
[markup] [markup]
@ -191,12 +201,12 @@ Please open the code block below to view the complete sample configuration :(far
```toml ```toml
[params] [params]
# site default theme ("light", "dark", "auto") # site default theme ["auto", "light", "dark"]
defaultTheme = "auto" defaultTheme = "auto"
# public git repo url only then enableGitInfo is true # public git repo url only then enableGitInfo is true
gitRepo = "" gitRepo = ""
# {{< version 0.1.1 >}} which hash function used for SRI, when empty, no SRI is used # {{< version 0.1.1 >}} which hash function used for SRI, when empty, no SRI is used
# ("sha256", "sha384", "sha512", "md5") # ["sha256", "sha384", "sha512", "md5"]
fingerprint = "" fingerprint = ""
# {{< version 0.2.0 >}} date format # {{< version 0.2.0 >}} date format
dateFormat = "2006-01-02" dateFormat = "2006-01-02"
@ -209,9 +219,9 @@ Please open the code block below to view the complete sample configuration :(far
# Header config # Header config
[params.header] [params.header]
# desktop header mode ("fixed", "normal", "auto") # desktop header mode ["fixed", "normal", "auto"]
desktopMode = "fixed" desktopMode = "fixed"
# mobile header mode ("fixed", "normal", "auto") # mobile header mode ["fixed", "normal", "auto"]
mobileMode = "auto" mobileMode = "auto"
# {{< version 0.2.0 >}} Header title config # {{< version 0.2.0 >}} Header title config
[params.header.title] [params.header.title]
@ -280,7 +290,7 @@ Please open the code block below to view the complete sample configuration :(far
# {{< version 0.2.0 >}} Search config # {{< version 0.2.0 >}} Search config
[params.search] [params.search]
enable = true enable = true
# type of search engine ("lunr", "algolia") # type of search engine ["lunr", "algolia"]
type = "lunr" type = "lunr"
# max index length of the chunked content # max index length of the chunked content
contentLength = 4000 contentLength = 4000
@ -518,7 +528,7 @@ Please open the code block below to view the complete sample configuration :(far
enableQQ = false enableQQ = false
serverURLs = "" serverURLs = ""
# {{< version 0.2.6 >}} emoji data file name, default is "google.yml" # {{< version 0.2.6 >}} emoji data file name, default is "google.yml"
# ("apple.yml", "google.yml", "facebook.yml", "twitter.yml") # ["apple.yml", "google.yml", "facebook.yml", "twitter.yml"]
# located in "themes/LoveIt/assets/data/emoji/" directory # located in "themes/LoveIt/assets/data/emoji/" directory
# you can store your own data files in the same path under your project: # you can store your own data files in the same path under your project:
# "assets/data/emoji/" # "assets/data/emoji/"
@ -625,7 +635,7 @@ Please open the code block below to view the complete sample configuration :(far
# {{< version 0.2.7 changed >}} CDN config for third-party library files # {{< version 0.2.7 changed >}} CDN config for third-party library files
[params.cdn] [params.cdn]
# CDN data file name, disabled by default # CDN data file name, disabled by default
# ("jsdelivr.yml") # ["jsdelivr.yml"]
# located in "themes/LoveIt/assets/data/cdn/" directory # located in "themes/LoveIt/assets/data/cdn/" directory
# you can store your own data files in the same path under your project: # you can store your own data files in the same path under your project:
# "assets/data/cdn/" # "assets/data/cdn/"
@ -667,12 +677,6 @@ Please open the code block below to view the complete sample configuration :(far
startLevel = 2 startLevel = 2
endLevel = 6 endLevel = 6
# Author config
[author]
name = "xxxx"
email = ""
link = ""
# Sitemap config # Sitemap config
[sitemap] [sitemap]
changefreq = "weekly" changefreq = "weekly"
@ -734,7 +738,7 @@ You could enable these features with `hugo serve -e production`.
```toml ```toml
[params.cdn] [params.cdn]
# CDN data file name, disabled by default # CDN data file name, disabled by default
# ("jsdelivr.yml") # ["jsdelivr.yml"]
data = "" data = ""
```` ````
@ -847,7 +851,7 @@ After learning [how Hugo handle multilingual websites](https://gohugo.io/content
For example with English, Chinese and French website: For example with English, Chinese and French website:
```toml ```toml
# [en, zh-cn, fr, pl, ...] determines default content language # determines default content language ["en", "zh-cn", "fr", "pl", ...]
defaultContentLanguage = "en" defaultContentLanguage = "en"
[languages] [languages]
@ -857,62 +861,60 @@ defaultContentLanguage = "en"
languageCode = "en" languageCode = "en"
languageName = "English" languageName = "English"
[[languages.en.menu.main]] [[languages.en.menu.main]]
weight = 1
identifier = "posts" identifier = "posts"
pre = "" pre = ""
post = "" post = ""
name = "Posts" name = "Posts"
url = "/posts/" url = "/posts/"
title = "" title = ""
weight = 1
[[languages.en.menu.main]] [[languages.en.menu.main]]
weight = 2
identifier = "tags" identifier = "tags"
pre = "" pre = ""
post = "" post = ""
name = "Tags" name = "Tags"
url = "/tags/" url = "/tags/"
title = "" title = ""
weight = 2
[[languages.en.menu.main]] [[languages.en.menu.main]]
weight = 3
identifier = "categories" identifier = "categories"
pre = "" pre = ""
post = "" post = ""
name = "Categories" name = "Categories"
url = "/categories/" url = "/categories/"
title = "" title = ""
weight = 3
[languages.zh-cn] [languages.zh-cn]
weight = 2 weight = 2
title = "我的全新 Hugo 网站" title = "我的全新 Hugo 网站"
# language code, CN only here
languageCode = "zh-CN" languageCode = "zh-CN"
languageName = "简体中文" languageName = "简体中文"
# whether to include Chinese/Japanese/Korean
hasCJKLanguage = true hasCJKLanguage = true
[[languages.zh-cn.menu.main]] [[languages.zh-cn.menu.main]]
weight = 1
identifier = "posts" identifier = "posts"
pre = "" pre = ""
post = "" post = ""
name = "文章" name = "文章"
url = "/posts/" url = "/posts/"
title = "" title = ""
weight = 1
[[languages.zh-cn.menu.main]] [[languages.zh-cn.menu.main]]
weight = 2
identifier = "tags" identifier = "tags"
pre = "" pre = ""
post = "" post = ""
name = "标签" name = "标签"
url = "/tags/" url = "/tags/"
title = "" title = ""
weight = 2
[[languages.zh-cn.menu.main]] [[languages.zh-cn.menu.main]]
weight = 3
identifier = "categories" identifier = "categories"
pre = "" pre = ""
post = "" post = ""
name = "分类" name = "分类"
url = "/categories/" url = "/categories/"
title = "" title = ""
weight = 3
[languages.fr] [languages.fr]
weight = 3 weight = 3
@ -920,29 +922,29 @@ defaultContentLanguage = "en"
languageCode = "fr" languageCode = "fr"
languageName = "Français" languageName = "Français"
[[languages.fr.menu.main]] [[languages.fr.menu.main]]
weight = 1
identifier = "posts" identifier = "posts"
pre = "" pre = ""
post = "" post = ""
name = "Postes" name = "Postes"
url = "/posts/" url = "/posts/"
title = "" title = ""
weight = 1
[[languages.fr.menu.main]] [[languages.fr.menu.main]]
weight = 2
identifier = "tags" identifier = "tags"
pre = "" pre = ""
post = "" post = ""
name = "Balises" name = "Balises"
url = "/tags/" url = "/tags/"
title = "" title = ""
weight = 2
[[languages.fr.menu.main]] [[languages.fr.menu.main]]
weight = 3
identifier = "categories" identifier = "categories"
name = "Catégories" name = "Catégories"
pre = "" pre = ""
post = "" post = ""
url = "/categories/" url = "/categories/"
title = "" title = ""
weight = 3
``` ```
Then, for each new page, append the language code to the file name. Then, for each new page, append the language code to the file name.
@ -993,7 +995,7 @@ Here is the search configuration in your [site configuration](#site-configuratio
```toml ```toml
[params.search] [params.search]
enable = true enable = true
# type of search engine ("lunr", "algolia") # type of search engine ["lunr", "algolia"]
type = "lunr" type = "lunr"
# max index length of the chunked content # max index length of the chunked content
contentLength = 4000 contentLength = 4000

View file

@ -77,24 +77,30 @@ git submodule add https://github.com/dillonzq/LoveIt.git themes/LoveIt
```toml ```toml
baseURL = "http://example.org/" baseURL = "http://example.org/"
# [en, zh-cn, fr, ...] 设置默认的语言
defaultContentLanguage = "zh-cn"
# 网站语言, 仅在这里 CN 大写
languageCode = "zh-CN"
# 是否包括中日韩文字
hasCJKLanguage = true
# 网站标题
title = "我的全新 Hugo 网站"
# 更改使用 Hugo 构建网站时使用的默认主题 # 更改使用 Hugo 构建网站时使用的默认主题
theme = "LoveIt" theme = "LoveIt"
[params] # 网站标题
# LoveIt 主题版本 title = "我的全新 Hugo 网站"
version = "0.2.X"
# 网站语言, 仅在这里 CN 大写 ["en", "zh-CN", "fr", "pl", ...]
languageCode = "zh-CN"
# 语言名称 ["English", "简体中文", "Français", "Polski", ...]
languageName = "简体中文"
# 是否包括中日韩文字
hasCJKLanguage = true
# 作者配置
[author]
name = "xxxx"
email = ""
link = ""
# 菜单配置
[menu] [menu]
[[menu.main]] [[menu.main]]
weight = 1
identifier = "posts" identifier = "posts"
# 你可以在名称 (允许 HTML 格式) 之前添加其他信息, 例如图标 # 你可以在名称 (允许 HTML 格式) 之前添加其他信息, 例如图标
pre = "" pre = ""
@ -104,23 +110,22 @@ theme = "LoveIt"
url = "/posts/" url = "/posts/"
# 当你将鼠标悬停在此菜单链接上时, 将显示的标题 # 当你将鼠标悬停在此菜单链接上时, 将显示的标题
title = "" title = ""
weight = 1
[[menu.main]] [[menu.main]]
weight = 2
identifier = "tags" identifier = "tags"
pre = "" pre = ""
post = "" post = ""
name = "标签" name = "标签"
url = "/tags/" url = "/tags/"
title = "" title = ""
weight = 2
[[menu.main]] [[menu.main]]
weight = 3
identifier = "categories" identifier = "categories"
pre = "" pre = ""
post = "" post = ""
name = "分类" name = "分类"
url = "/categories/" url = "/categories/"
title = "" title = ""
weight = 3
# Hugo 解析文档的配置 # Hugo 解析文档的配置
[markup] [markup]
@ -198,12 +203,12 @@ hugo
```toml ```toml
[params] [params]
# 网站默认主题样式 ("light", "dark", "auto") # 网站默认主题样式 ["auto", "light", "dark"]
defaultTheme = "auto" defaultTheme = "auto"
# 公共 git 仓库路径,仅在 enableGitInfo 设为 true 时有效 # 公共 git 仓库路径,仅在 enableGitInfo 设为 true 时有效
gitRepo = "" gitRepo = ""
# {{< version 0.1.1 >}} 哪种哈希函数用来 SRI, 为空时表示不使用 SRI # {{< version 0.1.1 >}} 哪种哈希函数用来 SRI, 为空时表示不使用 SRI
# ("sha256", "sha384", "sha512", "md5") # ["sha256", "sha384", "sha512", "md5"]
fingerprint = "" fingerprint = ""
# {{< version 0.2.0 >}} 日期格式 # {{< version 0.2.0 >}} 日期格式
dateFormat = "2006-01-02" dateFormat = "2006-01-02"
@ -216,9 +221,9 @@ hugo
# 页面头部导航栏配置 # 页面头部导航栏配置
[params.header] [params.header]
# 桌面端导航栏模式 ("fixed", "normal", "auto") # 桌面端导航栏模式 ["fixed", "normal", "auto"]
desktopMode = "fixed" desktopMode = "fixed"
# 移动端导航栏模式 ("fixed", "normal", "auto") # 移动端导航栏模式 ["fixed", "normal", "auto"]
mobileMode = "auto" mobileMode = "auto"
# {{< version 0.2.0 >}} 页面头部导航栏标题配置 # {{< version 0.2.0 >}} 页面头部导航栏标题配置
[params.header.title] [params.header.title]
@ -287,7 +292,7 @@ hugo
# {{< version 0.2.0 >}} 搜索配置 # {{< version 0.2.0 >}} 搜索配置
[params.search] [params.search]
enable = true enable = true
# 搜索引擎的类型 ("lunr", "algolia") # 搜索引擎的类型 ["lunr", "algolia"]
type = "lunr" type = "lunr"
# 文章内容最长索引长度 # 文章内容最长索引长度
contentLength = 4000 contentLength = 4000
@ -525,7 +530,7 @@ hugo
enableQQ = false enableQQ = false
serverURLs = "" serverURLs = ""
# {{< version 0.2.6 >}} emoji 数据文件名称, 默认是 "google.yml" # {{< version 0.2.6 >}} emoji 数据文件名称, 默认是 "google.yml"
# ("apple.yml", "google.yml", "facebook.yml", "twitter.yml") # ["apple.yml", "google.yml", "facebook.yml", "twitter.yml"]
# 位于 "themes/LoveIt/assets/data/emoji/" 目录 # 位于 "themes/LoveIt/assets/data/emoji/" 目录
# 可以在你的项目下相同路径存放你自己的数据文件: # 可以在你的项目下相同路径存放你自己的数据文件:
# "assets/data/emoji/" # "assets/data/emoji/"
@ -632,7 +637,7 @@ hugo
# {{< version 0.2.7 changed >}} 第三方库文件的 CDN 设置 # {{< version 0.2.7 changed >}} 第三方库文件的 CDN 设置
[params.cdn] [params.cdn]
# CDN 数据文件名称, 默认不启用 # CDN 数据文件名称, 默认不启用
# ("jsdelivr.yml") # ["jsdelivr.yml"]
# 位于 "themes/LoveIt/assets/data/cdn/" 目录 # 位于 "themes/LoveIt/assets/data/cdn/" 目录
# 可以在你的项目下相同路径存放你自己的数据文件: # 可以在你的项目下相同路径存放你自己的数据文件:
# "assets/data/cdn/" # "assets/data/cdn/"
@ -674,12 +679,6 @@ hugo
startLevel = 2 startLevel = 2
endLevel = 6 endLevel = 6
# 作者配置
[author]
name = "xxxx"
email = ""
link = ""
# 网站地图配置 # 网站地图配置
[sitemap] [sitemap]
changefreq = "weekly" changefreq = "weekly"
@ -742,7 +741,7 @@ hugo
```toml ```toml
[params.cdn] [params.cdn]
# CDN 数据文件名称, 默认不启用 # CDN 数据文件名称, 默认不启用
# ("jsdelivr.yml") # ["jsdelivr.yml"]
data = "" data = ""
```` ````
@ -854,7 +853,7 @@ $code-font-family: Fira Mono, Source Code Pro, Menlo, Consolas, Monaco, monospac
例如, 一个支持英语, 中文和法语的网站配置: 例如, 一个支持英语, 中文和法语的网站配置:
```toml ```toml
# [en, zh-cn, fr, pl, ...] 设置默认的语言 # 设置默认的语言 ["en", "zh-cn", "fr", "pl", ...]
defaultContentLanguage = "zh-cn" defaultContentLanguage = "zh-cn"
[languages] [languages]
@ -864,62 +863,60 @@ defaultContentLanguage = "zh-cn"
languageCode = "en" languageCode = "en"
languageName = "English" languageName = "English"
[[languages.en.menu.main]] [[languages.en.menu.main]]
weight = 1
identifier = "posts" identifier = "posts"
pre = "" pre = ""
post = "" post = ""
name = "Posts" name = "Posts"
url = "/posts/" url = "/posts/"
title = "" title = ""
weight = 1
[[languages.en.menu.main]] [[languages.en.menu.main]]
weight = 2
identifier = "tags" identifier = "tags"
pre = "" pre = ""
post = "" post = ""
name = "Tags" name = "Tags"
url = "/tags/" url = "/tags/"
title = "" title = ""
weight = 2
[[languages.en.menu.main]] [[languages.en.menu.main]]
weight = 3
identifier = "categories" identifier = "categories"
pre = "" pre = ""
post = "" post = ""
name = "Categories" name = "Categories"
url = "/categories/" url = "/categories/"
title = "" title = ""
weight = 3
[languages.zh-cn] [languages.zh-cn]
weight = 2 weight = 2
title = "我的全新 Hugo 网站" title = "我的全新 Hugo 网站"
# 网站语言, 仅在这里 CN 大写
languageCode = "zh-CN" languageCode = "zh-CN"
languageName = "简体中文" languageName = "简体中文"
# 是否包括中日韩文字
hasCJKLanguage = true hasCJKLanguage = true
[[languages.zh-cn.menu.main]] [[languages.zh-cn.menu.main]]
weight = 1
identifier = "posts" identifier = "posts"
pre = "" pre = ""
post = "" post = ""
name = "文章" name = "文章"
url = "/posts/" url = "/posts/"
title = "" title = ""
weight = 1
[[languages.zh-cn.menu.main]] [[languages.zh-cn.menu.main]]
weight = 2
identifier = "tags" identifier = "tags"
pre = "" pre = ""
post = "" post = ""
name = "标签" name = "标签"
url = "/tags/" url = "/tags/"
title = "" title = ""
weight = 2
[[languages.zh-cn.menu.main]] [[languages.zh-cn.menu.main]]
weight = 3
identifier = "categories" identifier = "categories"
pre = "" pre = ""
post = "" post = ""
name = "分类" name = "分类"
url = "/categories/" url = "/categories/"
title = "" title = ""
weight = 3
[languages.fr] [languages.fr]
weight = 3 weight = 3
@ -927,29 +924,29 @@ defaultContentLanguage = "zh-cn"
languageCode = "fr" languageCode = "fr"
languageName = "Français" languageName = "Français"
[[languages.fr.menu.main]] [[languages.fr.menu.main]]
weight = 1
identifier = "posts" identifier = "posts"
pre = "" pre = ""
post = "" post = ""
name = "Postes" name = "Postes"
url = "/posts/" url = "/posts/"
title = "" title = ""
weight = 1
[[languages.fr.menu.main]] [[languages.fr.menu.main]]
weight = 2
identifier = "tags" identifier = "tags"
pre = "" pre = ""
post = "" post = ""
name = "Balises" name = "Balises"
url = "/tags/" url = "/tags/"
title = "" title = ""
weight = 2
[[languages.fr.menu.main]] [[languages.fr.menu.main]]
weight = 3
identifier = "categories" identifier = "categories"
pre = "" pre = ""
post = "" post = ""
name = "Catégories" name = "Catégories"
url = "/categories/" url = "/categories/"
title = "" title = ""
weight = 3
``` ```
然后, 对于每个新页面, 将语言代码附加到文件名中. 然后, 对于每个新页面, 将语言代码附加到文件名中.
@ -1001,7 +998,7 @@ defaultContentLanguage = "zh-cn"
```toml ```toml
[params.search] [params.search]
enable = true enable = true
# 搜索引擎的类型 ("lunr", "algolia") # 搜索引擎的类型 ["lunr", "algolia"]
type = "lunr" type = "lunr"
# 文章内容最长索引长度 # 文章内容最长索引长度
contentLength = 4000 contentLength = 4000