diff --git a/hugo.toml b/hugo.toml index 35510a6..d1d9527 100644 --- a/hugo.toml +++ b/hugo.toml @@ -5,3 +5,4 @@ path = "github.com/hugomods/icons/vendors/bootstrap" date_format = ":date_full" icons = true font_size = ".825rem" +created_at = true diff --git a/layouts/partials/hb/modules/revision/index.html b/layouts/partials/hb/modules/revision/index.html index 0fd4e5f..84a999f 100644 --- a/layouts/partials/hb/modules/revision/index.html +++ b/layouts/partials/hb/modules/revision/index.html @@ -1,3 +1,5 @@ +{{- $createdAt := default true site.Params.hb.revision.created_at }} +{{- if or $createdAt (ne .Lastmod .Date) }}
{{- $params := site.Params.hb.revision }} {{- $icons := default true $params.icons }} @@ -14,14 +16,17 @@ {{- end }} {{- end }} - {{- $date := .Date | time.Format $format }} - {{- $dateFull := printf "%s %s" (.Date | time.Format ":date_full") (.Date | time.Format ":time_full") }} - - {{- if $icons }} - {{ partial "icons/icon" (dict "vendor" "bs" "name" "calendar-plus") }} - {{ $date }} - {{- else }} - {{ i18n `created_at` (dict `Date` $date) }} - {{- end }} - + {{- if $createdAt }} + {{- $date := .Date | time.Format $format }} + {{- $dateFull := printf "%s %s" (.Date | time.Format ":date_full") (.Date | time.Format ":time_full") }} + + {{- if $icons }} + {{ partial "icons/icon" (dict "vendor" "bs" "name" "calendar-plus") }} + {{ $date }} + {{- else }} + {{ i18n `created_at` (dict `Date` $date) }} + {{- end }} + + {{- end }}
+{{- end }}