Merge pull request #30 from younsl/config/support-toggle-footer

feat(config): Support toggle option for footer display
This commit is contained in:
Hanwen Guo 2024-11-30 21:10:16 -07:00 committed by GitHub
commit 1096ed99f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 32 additions and 21 deletions

View File

@ -1,7 +1,7 @@
[module] [module]
[module.hugoVersion] [module.hugoVersion]
extended=true extended = true
min = "0.41.0" min = "0.41.0"
[markup] [markup]
[markup.goldmark] [markup.goldmark]
@ -9,28 +9,31 @@
[markup.goldmark.parser.attribute] [markup.goldmark.parser.attribute]
block = true block = true
title = true title = true
[markup.highlight] [markup.highlight]
anchorLineNos = false anchorLineNos = false
codeFences = true codeFences = true
guessSyntax = false guessSyntax = false
hl_Lines = '' hl_Lines = ''
hl_inline = false hl_inline = false
lineAnchors = '' lineAnchors = ''
lineNoStart = 1 lineNoStart = 1
lineNos = false lineNos = false
lineNumbersInTable = true lineNumbersInTable = true
noClasses = true noClasses = true
noHl = false noHl = false
style = 'rrt' style = 'rrt'
tabWidth = 4 tabWidth = 4
[markup.tableOfContents] [markup.tableOfContents]
startLevel = 2 startLevel = 2
endLevel = 3 endLevel = 3
ordered = false ordered = false
[params] [params]
[params.theme_config] [params.theme_config]
appearance = "auto" appearance = "auto"
back_home_text = ".." back_home_text = ".."
date_format = "2006-01-02" date_format = "2006-01-02"
isListGroupByDate = false isListGroupByDate = false
isShowFooter = true

View File

@ -1,2 +1,10 @@
{{ $footerContent := readFile "layouts/footer.md" }} {{ if site.Params.theme_config.isShowFooter }}
{{ $footerContent | markdownify }} {{ with resources.Get "layouts/footer.md" }}
{{ .Content | markdownify }}
{{ else }}
{{ warnf "layouts/footer.md file is not found, fallback to the default copyright" }}
<footer class="site-footer">
<p>&copy; {{ now.Format "2006" }} {{ site.Title }}</p>
</footer>
{{ end }}
{{ end }}