diff --git a/layouts/_partials/footer/copyright.html b/layouts/_partials/footer/copyright.html index 1370c5e1f4..7f033cce19 100644 --- a/layouts/_partials/footer/copyright.html +++ b/layouts/_partials/footer/copyright.html @@ -1,21 +1,21 @@ {{ $page := .Page -}} {{ with .Site.Params.copyright -}} - {{ $fromYear := "" -}} - {{ $toYear := "" -}} + {{ $yearRange := slice -}} {{ $authors := "" -}} {{ if reflect.IsMap . -}} - {{ $fromYear = .from_year -}} - {{ $toYear = .to_year -}} + {{ with .from_year -}} + {{ $yearRange = slice . -}} + {{ end -}} + {{ $yearRange = $yearRange + | append (.to_year | default now.Year) + | uniq -}} {{ $authors = .authors -}} {{ else -}} {{ $authors = . -}} {{ end -}} © - {{ with $fromYear -}} - {{ . }}– - {{- end -}} - {{ $toYear | default now.Year }} + {{ delimit $yearRange "–" }} {{- $authors | default (printf "%s Authors" ($.Site.Title | default "Site"))