mirror of https://github.com/theNewDynamic/gohugo-theme-ananke.git

Patrick Kollitsch
19 hours ago 2c68aad9d33c95a629a1ad4a81ed116fafe9c40d
fix: respect date display setting in summaries
1 files modified
18 ■■■■■ changed files
layouts/summary.html 18 ●●●●● patch | view | raw | blame | history
layouts/summary.html
@@ -1,6 +1,24 @@
{{ $show_date := and
    (not .Date.IsZero)
    (or
        (and
            (not (eq false site.Params.ananke.pages.show_date))
            (not (eq false .Params.ananke.show_date))
        )
        (and
            (eq false site.Params.ananke.pages.show_date)
            (eq true .Params.ananke.show_date)
        )
    )
}}
<div class="w-100 mb4 nested-copy-line-height relative bg-white">
  <div class="mb3 pa4 gray overflow-hidden bg-white">
    {{with .CurrentSection.Title }}<span class="f6 db">{{ . }}</span>{{end}}
    {{ if $show_date }}
      <time class="f6 db" {{ fmt.Printf `datetime="%s"` (.Date.Format "2006-01-02T15:04:05Z07:00") | safe.HTMLAttr }}>
        {{- .Date | time.Format (compare.Default "January 2, 2006" .Site.Params.date_format) -}}
      </time>
    {{ end }}
    <h1 class="f3 near-black">
      <a href="{{ .RelPermalink }}" class="link black dim">
        {{ .Title }}