diff options
| author | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-22 20:08:00 +0200 |
|---|---|---|
| committer | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-22 20:08:00 +0200 |
| commit | dd22a51f556f1039c53c843e2dae90b5c0d583e4 (patch) | |
| tree | a20adf7f3fc9d7cadcd181c27bb4cd8f10528ef5 /layouts/partials | |
| parent | 36150b5f88b2e513c6791b62aaf5eb3401d1c8a2 (diff) | |
| download | gohugo-theme-ed-dd22a51f556f1039c53c843e2dae90b5c0d583e4.tar.gz | |
Provide ability to use {year} placeholder in footer partial
Diffstat (limited to 'layouts/partials')
| -rw-r--r-- | layouts/partials/footer.html | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index c0a6d49..e66dfc6 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,8 +1,10 @@ <div class="sidebar-item"> <p> - {{- with site.Params.footer }} - {{ . | safeHTML }} - {{- else }} + {{- with site.Params.footer -}} + {{- $footer_text := replace . "{year}" now.Year -}} + {{- $footer_text = replace $copyright "©" "©" }} + {{ $footer_text | safeHTML }} + {{- else }}{{- /* TODO: translate strings */ -}} {{- with .Params.editor }}<p>Edited by {{ . }}, {{ now.Format "2006" }}.</p>{{ end }} Built with <a href="https://github.com/sergeyklay/gohugo-theme-ed" target="_blank" rel="noopener noreferrer">Ed.</a> Distributed under an MIT license. |
