copyright.html 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. {{ $page := .Page -}}
  2. {{ with .Site.Params.copyright -}}
  3. {{ $fromYear := "" -}}
  4. {{ $toYear := "" -}}
  5. {{ $authors := "" -}}
  6. {{ if reflect.IsMap . -}}
  7. {{ $fromYear = .from_year -}}
  8. {{ $toYear = .to_year -}}
  9. {{ $authors = .authors -}}
  10. {{ else -}}
  11. {{ $authors = . -}}
  12. {{ end -}}
  13. <span class="td-footer__copyright">&copy;
  14. {{ with $fromYear -}}
  15. {{ . }}&ndash;
  16. {{- end -}}
  17. {{ $toYear | default now.Year }}
  18. <span class="td-footer__authors">
  19. {{- $authors
  20. | default (printf "%s Authors" ($.Site.Title | default "Site"))
  21. | $page.RenderString -}}
  22. </span>
  23. {{- /* Trim WS */ -}}
  24. </span>
  25. {{- with T "footer_all_rights_reserved" -}}
  26. <span class="td-footer__all_rights_reserved">
  27. {{- . -}}
  28. </span>
  29. {{- end }}
  30. {{- else -}}
  31. {{ with .Site.Copyright -}}
  32. {{/* For historical reasons we process this as HTML rather than markdown. */ -}}
  33. <span class="td-footer__copyright">
  34. {{- . | safeHTML -}}
  35. </span>
  36. {{- end -}}
  37. {{ end -}}