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
+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 },
]