refactor: use TOML for configuration file (#1228)

* refactor: remove jsconfig.json

* chore: remove devcontainer config

* refactor: migrate Hugo configuration from `hugo.yaml` to dedicated `module.toml` and `params.toml` files, and update minimum Hugo version.

* refactor: migrate demo site configuration from `hugo.yaml` to `config/_default/*.toml`

* feat: enable local sidebar avatar for demo site and relocate its image to demo assets.

* feat: migrate demo site to Hugo Modules for theme management.

* fix: wrong config folder name
This commit is contained in:
Jimmy
2026-01-25 19:51:10 +01:00
committed by GitHub
parent ffab83a637
commit 406fcef7cd
16 changed files with 298 additions and 560 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

+26
View File
@@ -0,0 +1,26 @@
baseURL = "https://example.com/"
languageCode = "en-us"
title = "Example Site"
copyright = "Example Person"
# 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
[[module.imports]]
path = "github.com/CaiJimmy/hugo-theme-stack/v3"
[pagination]
pagerSize = 3
[permalinks]
post = "/p/:slug/"
page = "/:slug/"
[services.disqus]
shortname = "hugo-theme-stack"
+35
View File
@@ -0,0 +1,35 @@
[en]
languageName = "English"
title = "Example Site"
weight = 1
[en.params.sidebar]
subtitle = "Example description"
[zh-cn]
languageName = "简体中文"
title = "演示站点"
weight = 2
[zh-cn.params.sidebar]
subtitle = "演示说明"
[zh-tw]
languageName = "正體中文"
title = "演示站點"
weight = 2
[zh-tw.params.sidebar]
subtitle = "演示說明"
[ja]
languageName = "日本語"
title = "サンプルサイト"
weight = 2
[ja.params.sidebar]
subtitle = "サンプル説明"
[ar]
languageName = "عربي"
languagedirection = "rtl"
title = "موقع تجريبي"
weight = 3
[ar.params.sidebar]
subtitle = "وصف تجريبي"
+24
View File
@@ -0,0 +1,24 @@
[goldmark]
[goldmark.extensions]
[goldmark.extensions.passthrough]
enable = true
[goldmark.extensions.passthrough.delimiters]
block = [["\\[", "\\]"], ["$$", "$$"]]
inline = [["\\(", "\\)"]]
[goldmark.renderer]
## Set to true if you have HTML content inside Markdown
unsafe = true
[tableOfContents]
endLevel = 4
ordered = true
startLevel = 2
[highlight]
noClasses = false
codeFences = true
guessSyntax = true
lineNoStart = 1
lineNos = true
lineNumbersInTable = true
tabWidth = 4
+13
View File
@@ -0,0 +1,13 @@
[[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"
+37
View File
@@ -0,0 +1,37 @@
mainSections = ["post"]
rssFullContent = true
favicon = ""
[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]
[article.license]
enabled = true
default = "Licensed under CC BY-NC-SA 4.0"
[widgets]
homepage = [
{ type = "search" },
{ type = "archives", params = { limit = 5 } },
{ type = "categories", params = { limit = 10 } },
{ type = "tag-cloud", params = { limit = 10 } },
]
page = [{ type = "toc" }]
[comments]
# See complete configuration in config/_default/params.toml
enabled = true
provider = "disqus"
+8
View File
@@ -0,0 +1,8 @@
includeNewer = true
threshold = 60
toLower = false
indices = [
{ name = "tags", weight = 100 },
{ name = "categories", weight = 200 },
]
+7
View File
@@ -0,0 +1,7 @@
module github.com/CaiJimmy/hugo-theme-stack/demo
go 1.25.6
replace github.com/CaiJimmy/hugo-theme-stack/v3 => ../
require github.com/CaiJimmy/hugo-theme-stack/v3 v3.34.0 // indirect
-285
View File
@@ -1,285 +0,0 @@
baseurl: https://example.com/
languageCode: en-us
theme: hugo-theme-stack
title: Example Site
copyright: Example Person
# 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
languages:
en:
languageName: English
title: Example Site
weight: 1
params:
sidebar:
subtitle: Example description
zh-cn:
languageName: 简体中文
title: 演示站点
weight: 2
params:
sidebar:
subtitle: 演示说明
zh-tw:
languageName: 正體中文
title: 演示站點
weight: 2
params:
sidebar:
subtitle: 演示說明
ja:
languageName: 日本語
title: サンプルサイト
weight: 2
params:
sidebar:
subtitle: サンプル説明
ar:
languageName: عربي
languagedirection: rtl
title: موقع تجريبي
weight: 3
params:
sidebar:
subtitle: وصف تجريبي
services:
# Change it to your Disqus shortname before using
disqus:
shortname: "hugo-theme-stack"
# GA Tracking ID
googleAnalytics:
id:
pagination:
pagerSize: 3
permalinks:
post: /p/:slug/
page: /:slug/
params:
mainSections:
- post
featuredImageField: image
rssFullContent: true
favicon: # e.g.: favicon placed in `static/favicon.ico` of your site folder, then set this field to `/favicon.ico` (`/` is necessary)
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:
beaudar:
repo:
issueTerm: pathname
label:
theme:
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:
proxy:
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://stack.jimmycai.com/config/menu
### 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:
extensions:
passthrough:
enable: true
delimiters:
block:
- - \[
- \]
- - $$
- $$
inline:
- - \(
- \)
renderer:
## Set to true if you have HTML content inside Markdown
unsafe: true
tableOfContents:
endLevel: 4
ordered: true
startLevel: 2
highlight:
noClasses: false
codeFences: true
guessSyntax: true
lineNoStart: 1
lineNos: true
lineNumbersInTable: true
tabWidth: 4