mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-02-06 20:03:31 +08:00
refactor: migrate theme configuration to TOML
This commit is contained in:
parent
6cff36abee
commit
2d9c27a7c6
141
config.yaml
141
config.yaml
@ -1,141 +0,0 @@
|
|||||||
module:
|
|
||||||
hugoVersion:
|
|
||||||
extended: true
|
|
||||||
min: "0.87.0"
|
|
||||||
|
|
||||||
params:
|
|
||||||
mainSections:
|
|
||||||
- post
|
|
||||||
featuredImageField: image
|
|
||||||
rssFullContent: true
|
|
||||||
favicon:
|
|
||||||
|
|
||||||
footer:
|
|
||||||
since:
|
|
||||||
customText:
|
|
||||||
|
|
||||||
dateFormat:
|
|
||||||
published: Jan 02, 2006
|
|
||||||
lastUpdated: Jan 02, 2006 15:04 MST
|
|
||||||
|
|
||||||
sidebar:
|
|
||||||
compact: false
|
|
||||||
emoji:
|
|
||||||
subtitle:
|
|
||||||
avatar:
|
|
||||||
enabled: true
|
|
||||||
local: true
|
|
||||||
src: img/avatar.png
|
|
||||||
|
|
||||||
article:
|
|
||||||
math: false
|
|
||||||
toc: true
|
|
||||||
readingTime: true
|
|
||||||
license:
|
|
||||||
enabled: false
|
|
||||||
default: Licensed under CC BY-NC-SA 4.0
|
|
||||||
|
|
||||||
comments:
|
|
||||||
enabled: false
|
|
||||||
provider: disqus
|
|
||||||
|
|
||||||
disqusjs:
|
|
||||||
shortname:
|
|
||||||
apiUrl:
|
|
||||||
apiKey:
|
|
||||||
admin:
|
|
||||||
adminLabel:
|
|
||||||
|
|
||||||
utterances:
|
|
||||||
repo:
|
|
||||||
issueTerm: pathname
|
|
||||||
label:
|
|
||||||
|
|
||||||
remark42:
|
|
||||||
host:
|
|
||||||
site:
|
|
||||||
locale:
|
|
||||||
|
|
||||||
vssue:
|
|
||||||
platform:
|
|
||||||
owner:
|
|
||||||
repo:
|
|
||||||
clientId:
|
|
||||||
clientSecret:
|
|
||||||
autoCreateIssue: false
|
|
||||||
|
|
||||||
# Waline client configuration see: https://waline.js.org/en/reference/client.html
|
|
||||||
waline:
|
|
||||||
serverURL:
|
|
||||||
lang:
|
|
||||||
visitor:
|
|
||||||
avatar:
|
|
||||||
emoji:
|
|
||||||
- https://cdn.jsdelivr.net/gh/walinejs/emojis/weibo
|
|
||||||
requiredMeta:
|
|
||||||
- name
|
|
||||||
- email
|
|
||||||
- url
|
|
||||||
placeholder:
|
|
||||||
locale:
|
|
||||||
admin: Admin
|
|
||||||
|
|
||||||
twikoo:
|
|
||||||
envId:
|
|
||||||
region:
|
|
||||||
path:
|
|
||||||
lang:
|
|
||||||
|
|
||||||
giscus:
|
|
||||||
repo:
|
|
||||||
repoID:
|
|
||||||
category:
|
|
||||||
categoryID:
|
|
||||||
mapping:
|
|
||||||
lightTheme:
|
|
||||||
darkTheme:
|
|
||||||
reactionsEnabled: 1
|
|
||||||
emitMetadata: 0
|
|
||||||
lang:
|
|
||||||
|
|
||||||
gitalk:
|
|
||||||
owner:
|
|
||||||
admin:
|
|
||||||
repo:
|
|
||||||
clientID:
|
|
||||||
clientSecret:
|
|
||||||
|
|
||||||
cusdis:
|
|
||||||
host:
|
|
||||||
id:
|
|
||||||
|
|
||||||
widgets:
|
|
||||||
homepage: []
|
|
||||||
page: []
|
|
||||||
|
|
||||||
opengraph:
|
|
||||||
twitter:
|
|
||||||
# Your Twitter username
|
|
||||||
site:
|
|
||||||
|
|
||||||
# Available values: summary, summary_large_image
|
|
||||||
card: summary_large_image
|
|
||||||
|
|
||||||
defaultImage:
|
|
||||||
opengraph:
|
|
||||||
enabled: false
|
|
||||||
local: false
|
|
||||||
src:
|
|
||||||
|
|
||||||
colorScheme:
|
|
||||||
# Display toggle
|
|
||||||
toggle: true
|
|
||||||
|
|
||||||
# Available values: auto, light, dark
|
|
||||||
default: auto
|
|
||||||
|
|
||||||
imageProcessing:
|
|
||||||
cover:
|
|
||||||
enabled: true
|
|
||||||
content:
|
|
||||||
enabled: true
|
|
3
config/_default/module.toml
Normal file
3
config/_default/module.toml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[hugoVersion]
|
||||||
|
extended = true
|
||||||
|
min = "0.87.0"
|
52
config/_default/params.toml
Normal file
52
config/_default/params.toml
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
# Theme's default configuration
|
||||||
|
mainSections = ["post"]
|
||||||
|
featuredImageField = "image"
|
||||||
|
rssFullContent = true
|
||||||
|
|
||||||
|
[footer]
|
||||||
|
|
||||||
|
[dateFormat]
|
||||||
|
published = "Jan 02, 2006"
|
||||||
|
lastUpdated = "Jan 02, 2006 15:04 MST"
|
||||||
|
|
||||||
|
[sidebar]
|
||||||
|
compact = false
|
||||||
|
|
||||||
|
[sidebar.avatar]
|
||||||
|
enabled = true
|
||||||
|
local = true
|
||||||
|
src = "img/avatar.png"
|
||||||
|
|
||||||
|
[article]
|
||||||
|
math = false
|
||||||
|
toc = true
|
||||||
|
readingTime = true
|
||||||
|
|
||||||
|
[article.license]
|
||||||
|
enabled = false
|
||||||
|
default = "Licensed under CC BY-NC-SA 4.0"
|
||||||
|
|
||||||
|
[comments]
|
||||||
|
enabled = false
|
||||||
|
provider = "disqus"
|
||||||
|
|
||||||
|
[widgets]
|
||||||
|
homepage = []
|
||||||
|
page = []
|
||||||
|
|
||||||
|
[opengraph.twitter]
|
||||||
|
card = "summary_large_image"
|
||||||
|
|
||||||
|
[defaultImage.opengraph]
|
||||||
|
enabled = false
|
||||||
|
local = false
|
||||||
|
|
||||||
|
[colorScheme]
|
||||||
|
toggle = true
|
||||||
|
default = "auto"
|
||||||
|
|
||||||
|
[imageProcessing.cover]
|
||||||
|
enabled = true
|
||||||
|
|
||||||
|
[imageProcessing.content]
|
||||||
|
enabled = true
|
@ -1 +0,0 @@
|
|||||||
Example site modified from https://github.com/gohugoio/hugoBasicExample
|
|
@ -1,236 +0,0 @@
|
|||||||
baseurl: https://example.com
|
|
||||||
languageCode: en-us
|
|
||||||
theme: hugo-theme-stack
|
|
||||||
paginate: 5
|
|
||||||
title: Example Site
|
|
||||||
|
|
||||||
languages:
|
|
||||||
en:
|
|
||||||
languageName: English
|
|
||||||
title: Example Site
|
|
||||||
weight: 1
|
|
||||||
zh-cn:
|
|
||||||
languageName: 中文
|
|
||||||
title: 演示站点
|
|
||||||
weight: 2
|
|
||||||
ar:
|
|
||||||
languageName: عربي
|
|
||||||
languagedirection: rtl
|
|
||||||
title: موقع تجريبي
|
|
||||||
weight: 3
|
|
||||||
|
|
||||||
# Change it to your Disqus shortname before using
|
|
||||||
disqusShortname: hugo-theme-stack
|
|
||||||
|
|
||||||
# GA Tracking ID
|
|
||||||
googleAnalytics:
|
|
||||||
|
|
||||||
# Theme i18n support
|
|
||||||
# Available values: ar, bn, ca, de, el, en, es, fr, hu, id, it, ja, ko, nl, pt-br, th, uk, zh-cn, zh-hk, zh-tw
|
|
||||||
DefaultContentLanguage: en
|
|
||||||
|
|
||||||
# Set hasCJKLanguage to true if DefaultContentLanguage is in [zh-cn ja ko]
|
|
||||||
# This will make .Summary and .WordCount behave correctly for CJK languages.
|
|
||||||
hasCJKLanguage: false
|
|
||||||
|
|
||||||
permalinks:
|
|
||||||
post: /p/:slug/
|
|
||||||
page: /:slug/
|
|
||||||
|
|
||||||
params:
|
|
||||||
mainSections:
|
|
||||||
- post
|
|
||||||
featuredImageField: image
|
|
||||||
rssFullContent: true
|
|
||||||
favicon:
|
|
||||||
|
|
||||||
footer:
|
|
||||||
since: 2020
|
|
||||||
customText:
|
|
||||||
|
|
||||||
dateFormat:
|
|
||||||
published: Jan 02, 2006
|
|
||||||
lastUpdated: Jan 02, 2006 15:04 MST
|
|
||||||
|
|
||||||
sidebar:
|
|
||||||
emoji: 🍥
|
|
||||||
subtitle: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
||||||
avatar:
|
|
||||||
enabled: true
|
|
||||||
local: true
|
|
||||||
src: img/avatar.png
|
|
||||||
|
|
||||||
article:
|
|
||||||
math: false
|
|
||||||
toc: true
|
|
||||||
readingTime: true
|
|
||||||
license:
|
|
||||||
enabled: true
|
|
||||||
default: Licensed under CC BY-NC-SA 4.0
|
|
||||||
|
|
||||||
comments:
|
|
||||||
enabled: true
|
|
||||||
provider: disqus
|
|
||||||
|
|
||||||
disqusjs:
|
|
||||||
shortname:
|
|
||||||
apiUrl:
|
|
||||||
apiKey:
|
|
||||||
admin:
|
|
||||||
adminLabel:
|
|
||||||
|
|
||||||
utterances:
|
|
||||||
repo:
|
|
||||||
issueTerm: pathname
|
|
||||||
label:
|
|
||||||
|
|
||||||
remark42:
|
|
||||||
host:
|
|
||||||
site:
|
|
||||||
locale:
|
|
||||||
|
|
||||||
vssue:
|
|
||||||
platform:
|
|
||||||
owner:
|
|
||||||
repo:
|
|
||||||
clientId:
|
|
||||||
clientSecret:
|
|
||||||
autoCreateIssue: false
|
|
||||||
|
|
||||||
# Waline client configuration see: https://waline.js.org/en/reference/component.html
|
|
||||||
waline:
|
|
||||||
serverURL:
|
|
||||||
lang:
|
|
||||||
pageview:
|
|
||||||
emoji:
|
|
||||||
- https://unpkg.com/@waline/emojis@1.0.1/weibo
|
|
||||||
requiredMeta:
|
|
||||||
- name
|
|
||||||
- email
|
|
||||||
- url
|
|
||||||
locale:
|
|
||||||
admin: Admin
|
|
||||||
placeholder:
|
|
||||||
|
|
||||||
twikoo:
|
|
||||||
envId:
|
|
||||||
region:
|
|
||||||
path:
|
|
||||||
lang:
|
|
||||||
|
|
||||||
# See https://cactus.chat/docs/reference/web-client/#configuration for description of the various options
|
|
||||||
cactus:
|
|
||||||
defaultHomeserverUrl: "https://matrix.cactus.chat:8448"
|
|
||||||
serverName: "cactus.chat"
|
|
||||||
siteName: "" # You must insert a unique identifier here matching the one you registered (See https://cactus.chat/docs/getting-started/quick-start/#register-your-site)
|
|
||||||
|
|
||||||
giscus:
|
|
||||||
repo:
|
|
||||||
repoID:
|
|
||||||
category:
|
|
||||||
categoryID:
|
|
||||||
mapping:
|
|
||||||
lightTheme:
|
|
||||||
darkTheme:
|
|
||||||
reactionsEnabled: 1
|
|
||||||
emitMetadata: 0
|
|
||||||
|
|
||||||
gitalk:
|
|
||||||
owner:
|
|
||||||
admin:
|
|
||||||
repo:
|
|
||||||
clientID:
|
|
||||||
clientSecret:
|
|
||||||
|
|
||||||
cusdis:
|
|
||||||
host:
|
|
||||||
id:
|
|
||||||
widgets:
|
|
||||||
homepage:
|
|
||||||
- type: search
|
|
||||||
- type: archives
|
|
||||||
params:
|
|
||||||
limit: 5
|
|
||||||
- type: categories
|
|
||||||
params:
|
|
||||||
limit: 10
|
|
||||||
- type: tag-cloud
|
|
||||||
params:
|
|
||||||
limit: 10
|
|
||||||
page:
|
|
||||||
- type: toc
|
|
||||||
|
|
||||||
opengraph:
|
|
||||||
twitter:
|
|
||||||
# Your Twitter username
|
|
||||||
site:
|
|
||||||
|
|
||||||
# Available values: summary, summary_large_image
|
|
||||||
card: summary_large_image
|
|
||||||
|
|
||||||
defaultImage:
|
|
||||||
opengraph:
|
|
||||||
enabled: false
|
|
||||||
local: false
|
|
||||||
src:
|
|
||||||
|
|
||||||
colorScheme:
|
|
||||||
# Display toggle
|
|
||||||
toggle: true
|
|
||||||
|
|
||||||
# Available values: auto, light, dark
|
|
||||||
default: auto
|
|
||||||
|
|
||||||
imageProcessing:
|
|
||||||
cover:
|
|
||||||
enabled: true
|
|
||||||
content:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
### Custom menu
|
|
||||||
### See https://docs.stack.jimmycai.com/configuration/custom-menu.html
|
|
||||||
### To remove about, archive and search page menu item, remove `menu` field from their FrontMatter
|
|
||||||
menu:
|
|
||||||
main: []
|
|
||||||
|
|
||||||
social:
|
|
||||||
- identifier: github
|
|
||||||
name: GitHub
|
|
||||||
url: https://github.com/CaiJimmy/hugo-theme-stack
|
|
||||||
params:
|
|
||||||
icon: brand-github
|
|
||||||
|
|
||||||
- identifier: twitter
|
|
||||||
name: Twitter
|
|
||||||
url: https://twitter.com
|
|
||||||
params:
|
|
||||||
icon: brand-twitter
|
|
||||||
|
|
||||||
related:
|
|
||||||
includeNewer: true
|
|
||||||
threshold: 60
|
|
||||||
toLower: false
|
|
||||||
indices:
|
|
||||||
- name: tags
|
|
||||||
weight: 100
|
|
||||||
|
|
||||||
- name: categories
|
|
||||||
weight: 200
|
|
||||||
|
|
||||||
markup:
|
|
||||||
goldmark:
|
|
||||||
renderer:
|
|
||||||
## Set to true if you have HTML content inside Markdown
|
|
||||||
unsafe: false
|
|
||||||
tableOfContents:
|
|
||||||
endLevel: 4
|
|
||||||
ordered: true
|
|
||||||
startLevel: 2
|
|
||||||
highlight:
|
|
||||||
noClasses: false
|
|
||||||
codeFences: true
|
|
||||||
guessSyntax: true
|
|
||||||
lineNoStart: 1
|
|
||||||
lineNos: true
|
|
||||||
lineNumbersInTable: true
|
|
||||||
tabWidth: 4
|
|
19
exampleSite/config/_default/config.toml
Normal file
19
exampleSite/config/_default/config.toml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Change baseurl before deploy
|
||||||
|
baseurl = "https://demo.stack.jimmycai.com"
|
||||||
|
languageCode = "en-us"
|
||||||
|
paginate = 5
|
||||||
|
title = "Hugo Theme Stack Starter"
|
||||||
|
|
||||||
|
# Theme i18n support
|
||||||
|
# Available values: ar, bn, ca, de, el, en, es, fr, hu, id, it, ja, ko, nl, pt-br, th, uk, zh-cn, zh-hk, zh-tw
|
||||||
|
DefaultContentLanguage = "en"
|
||||||
|
|
||||||
|
# Set hasCJKLanguage to true if DefaultContentLanguage is in [zh-cn ja ko]
|
||||||
|
# This will make .Summary and .WordCount behave correctly for CJK languages.
|
||||||
|
hasCJKLanguage = false
|
||||||
|
|
||||||
|
# Change it to your Disqus shortname before using
|
||||||
|
disqusShortname = "hugo-theme-stack"
|
||||||
|
|
||||||
|
# GA Tracking ID
|
||||||
|
googleAnalytics = ""
|
16
exampleSite/config/_default/languages.toml
Normal file
16
exampleSite/config/_default/languages.toml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Enable multilanguage site support
|
||||||
|
[en]
|
||||||
|
languageName = "English"
|
||||||
|
title = "Hugo Theme Stack Example Site"
|
||||||
|
weight = 1
|
||||||
|
|
||||||
|
[zh-cn]
|
||||||
|
languageName = "中文"
|
||||||
|
title = "Hugo 主题 Stack 演示站点"
|
||||||
|
weight = 2
|
||||||
|
|
||||||
|
[ar]
|
||||||
|
languageName = "عربي"
|
||||||
|
languagedirection = "rtl"
|
||||||
|
title = "موقع تجريبي"
|
||||||
|
weight = 3
|
18
exampleSite/config/_default/markup.toml
Normal file
18
exampleSite/config/_default/markup.toml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Markdown renderer configuration
|
||||||
|
[goldmark.renderer]
|
||||||
|
# Set it to true if you have HTML content inside Markdown
|
||||||
|
unsafe = false
|
||||||
|
|
||||||
|
[tableOfContents]
|
||||||
|
endLevel = 4
|
||||||
|
ordered = true
|
||||||
|
startLevel = 2
|
||||||
|
|
||||||
|
[highlight]
|
||||||
|
noClasses = false
|
||||||
|
codeFences = true
|
||||||
|
guessSyntax = true
|
||||||
|
lineNoStart = 1
|
||||||
|
lineNos = true
|
||||||
|
lineNumbersInTable = true
|
||||||
|
tabWidth = 4
|
20
exampleSite/config/_default/menu.toml
Normal file
20
exampleSite/config/_default/menu.toml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
### Custom menu
|
||||||
|
### See https://docs.stack.jimmycai.com/configuration/custom-menu.html
|
||||||
|
### To remove about, archive and search page menu item, remove `menu` field from their FrontMatter
|
||||||
|
main = []
|
||||||
|
|
||||||
|
[[social]]
|
||||||
|
identifier = "github"
|
||||||
|
name = "GitHub"
|
||||||
|
url = "https://github.com/CaiJimmy/hugo-theme-stack"
|
||||||
|
|
||||||
|
[social.params]
|
||||||
|
icon = "brand-github"
|
||||||
|
|
||||||
|
[[social]]
|
||||||
|
identifier = "twitter"
|
||||||
|
name = "Twitter"
|
||||||
|
url = "https://twitter.com"
|
||||||
|
|
||||||
|
[social.params]
|
||||||
|
icon = "brand-twitter"
|
105
exampleSite/config/_default/params.toml
Normal file
105
exampleSite/config/_default/params.toml
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
mainSections = ["post"]
|
||||||
|
featuredImageField = "image"
|
||||||
|
rssFullContent = true
|
||||||
|
|
||||||
|
[footer]
|
||||||
|
since = 2020
|
||||||
|
|
||||||
|
[dateFormat]
|
||||||
|
published = "Jan 02, 2006"
|
||||||
|
lastUpdated = "Jan 02, 2006 15:04 MST"
|
||||||
|
|
||||||
|
[sidebar]
|
||||||
|
emoji = "🍥"
|
||||||
|
subtitle = "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
|
||||||
|
|
||||||
|
[sidebar.avatar]
|
||||||
|
enabled = true
|
||||||
|
local = true
|
||||||
|
src = "img/avatar.png"
|
||||||
|
|
||||||
|
[article]
|
||||||
|
math = false
|
||||||
|
toc = true
|
||||||
|
readingTime = true
|
||||||
|
|
||||||
|
[article.license]
|
||||||
|
enabled = true
|
||||||
|
default = "Licensed under CC BY-NC-SA 4.0"
|
||||||
|
|
||||||
|
[comments]
|
||||||
|
enabled = true
|
||||||
|
provider = "disqus"
|
||||||
|
|
||||||
|
[comments.disqusjs]
|
||||||
|
|
||||||
|
[comments.utterances]
|
||||||
|
issueTerm = "pathname"
|
||||||
|
|
||||||
|
[comments.remark42]
|
||||||
|
|
||||||
|
[comments.vssue]
|
||||||
|
autoCreateIssue = false
|
||||||
|
|
||||||
|
[comments.waline]
|
||||||
|
emoji = ["https://unpkg.com/@waline/emojis@1.0.1/weibo"]
|
||||||
|
requiredMeta = ["name", "email", "url"]
|
||||||
|
|
||||||
|
[comments.waline.locale]
|
||||||
|
admin = "Admin"
|
||||||
|
|
||||||
|
[comments.twikoo]
|
||||||
|
|
||||||
|
[comments.cactus]
|
||||||
|
defaultHomeserverUrl = "https://matrix.cactus.chat:8448"
|
||||||
|
serverName = "cactus.chat"
|
||||||
|
siteName = ""
|
||||||
|
|
||||||
|
[comments.giscus]
|
||||||
|
reactionsEnabled = 1
|
||||||
|
emitMetadata = 0
|
||||||
|
|
||||||
|
[comments.gitalk]
|
||||||
|
|
||||||
|
[comments.cusdis]
|
||||||
|
|
||||||
|
[[widgets.homepage]]
|
||||||
|
type = "search"
|
||||||
|
|
||||||
|
[[widgets.homepage]]
|
||||||
|
type = "archives"
|
||||||
|
|
||||||
|
[widgets.homepage.params]
|
||||||
|
limit = 5
|
||||||
|
|
||||||
|
[[widgets.homepage]]
|
||||||
|
type = "categories"
|
||||||
|
|
||||||
|
[widgets.homepage.params]
|
||||||
|
limit = 10
|
||||||
|
|
||||||
|
[[widgets.homepage]]
|
||||||
|
type = "tag-cloud"
|
||||||
|
|
||||||
|
[widgets.homepage.params]
|
||||||
|
limit = 10
|
||||||
|
|
||||||
|
[[widgets.page]]
|
||||||
|
type = "toc"
|
||||||
|
|
||||||
|
[opengraph.twitter]
|
||||||
|
card = "summary_large_image"
|
||||||
|
|
||||||
|
[defaultImage.opengraph]
|
||||||
|
enabled = false
|
||||||
|
local = false
|
||||||
|
|
||||||
|
[colorScheme]
|
||||||
|
toggle = true
|
||||||
|
default = "auto"
|
||||||
|
|
||||||
|
[imageProcessing.cover]
|
||||||
|
enabled = true
|
||||||
|
|
||||||
|
[imageProcessing.content]
|
||||||
|
enabled = true
|
3
exampleSite/config/_default/permalinks.toml
Normal file
3
exampleSite/config/_default/permalinks.toml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Permalinks format of each content section
|
||||||
|
post = "/p/:slug/"
|
||||||
|
page = "/:slug/"
|
12
exampleSite/config/_default/related.toml
Normal file
12
exampleSite/config/_default/related.toml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# Related contents configuration
|
||||||
|
includeNewer = true
|
||||||
|
threshold = 60
|
||||||
|
toLower = false
|
||||||
|
|
||||||
|
[[indices]]
|
||||||
|
name = "tags"
|
||||||
|
weight = 100
|
||||||
|
|
||||||
|
[[indices]]
|
||||||
|
name = "categories"
|
||||||
|
weight = 200
|
Loading…
Reference in New Issue
Block a user