fix[footer]: allow defining markup language
Custom footer is currently rendered through .RenderString, that defaults to page's markup language, but page and footer could be written in two different languages (eg. footer in Markdown and page in Asciidoc). In this case the footer wouldn't be rendered correctly unless the markup language used is specified. Now it is possible.
This commit is contained in:
parent
994772696a
commit
30ecf2a834
|
@ -1,4 +1,5 @@
|
|||
# Common footer to use site-wide
|
||||
[[siteFooter]]
|
||||
text = "Powered by [Hugo](https://gohugo.io/) with [Simple Intro theme](https://github.com/qub1750ul/hugo-simpleIntro) - "
|
||||
markup = "markdown"
|
||||
# More footers could be defined to be used in specific pages/layouts
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<footer class="text-center mt-8 py-2 bg-gray-900 text-white">
|
||||
{{ range .Site.Data.site.footers.siteFooter}}
|
||||
<div>
|
||||
{{.text | $.RenderString }} © {{ now.Format "2006" }} {{ $.Site.Params.Name }}
|
||||
{{.text | $.RenderString (dict "markup" .markup)}} © {{ now.Format "2006" }} {{ $.Site.Params.Name }}
|
||||
</div>
|
||||
{{end}}
|
||||
</footer>
|
||||
|
|
Loading…
Reference in New Issue