feat[footer]: allow footer customization

A part of the footer (copyright/author/date) is hardcoded, while the
other part is loaded from a TOML (included in example site) and rendered
through .RenderString

Closes: #8
This commit is contained in:
f-dinucci 2022-05-31 00:29:40 +02:00 committed by Giuseppe Masino
parent df1a0fd2ea
commit 994772696a
2 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1,4 @@
# Common footer to use site-wide
[[siteFooter]]
text = "Powered by [Hugo](https://gohugo.io/) with [Simple Intro theme](https://github.com/qub1750ul/hugo-simpleIntro) - "
# More footers could be defined to be used in specific pages/layouts

View File

@ -1,3 +1,7 @@
<footer class="text-center mt-8 py-2 bg-gray-900 text-white">
<div>&copy; {{ now.Format "2006" }} {{ $.Site.Params.Name }}</div>
{{ range .Site.Data.site.footers.siteFooter}}
<div>
{{.text | $.RenderString }} &copy; {{ now.Format "2006" }} {{ $.Site.Params.Name }}
</div>
{{end}}
</footer>