feat(footer): add copyright since & custom text

closes https://github.com/CaiJimmy/hugo-theme-stack/issues/55
This commit is contained in:
Jimmy Cai 2020-12-20 12:25:29 +01:00
parent ddd6aa2d20
commit d22d6c4fb5
3 changed files with 16 additions and 2 deletions

View File

@ -22,6 +22,10 @@ params:
rssFullContent: true rssFullContent: true
favicon: favicon:
footer:
since: 2020
customText:
dateFormat: dateFormat:
published: Jan 02, 2006 published: Jan 02, 2006
lastUpdated: Jan 02, 2006 15:04 MST lastUpdated: Jan 02, 2006 15:04 MST

View File

@ -11,7 +11,7 @@
</section> </section>
{{- partial "pagination.html" . -}} {{- partial "pagination.html" . -}}
{{ partialCached "footer/footer" . }} {{- partial "footer/footer" . -}}
{{ end }} {{ end }}
{{ define "right-sidebar" }} {{ define "right-sidebar" }}

View File

@ -1,6 +1,16 @@
{{- $ThemeVersion := "1.1.0" -}} {{- $ThemeVersion := "1.1.0" -}}
<footer class="site-footer"> <footer class="site-footer">
<section class="copyright">&copy; {{ now.Format "2006" }} {{ .Site.Title }}</section> <section class="copyright">
&copy;
{{ if and (.Site.Params.footer.since) (ne .Site.Params.footer.since (int (now.Format "2006"))) }}
{{ .Site.Params.footer.since }} -
{{ end }}
{{ now.Format "2006" }} {{ .Site.Title }}
{{ with .Site.Params.footer.customText }}
<br/> {{ . | safeHTML }}
{{ end }}
</section>
<section class="powerby"> <section class="powerby">
{{- $Generator := `<a href="https://gohugo.io/" target="_blank" rel="noopener">Hugo</a>` -}} {{- $Generator := `<a href="https://gohugo.io/" target="_blank" rel="noopener">Hugo</a>` -}}
{{- $Theme := printf `<b><a href="https://github.com/CaiJimmy/hugo-theme-stack" target="_blank" rel="noopener" data-version="%s">Stack</a></b>` $ThemeVersion -}} {{- $Theme := printf `<b><a href="https://github.com/CaiJimmy/hugo-theme-stack" target="_blank" rel="noopener" data-version="%s">Stack</a></b>` $ThemeVersion -}}