itsdrike.com/layouts/partials/list_item.html
2022-05-11 14:38:42 +02:00

19 lines
723 B
HTML

<!-- Obtain "dateformat" from scratchpad (or fall back to default) -->
{{ if not (.Scratch.Get "dateformat") }}
{{ .Scratch.Set "dateformat" "Jan 02, 2006" }}
{{ end }}
{{ $dateformat := .Scratch.Get "dateformat" }}
<!-- Reset scratchpad for next use (in next page) - avoids using old values -->
{{ .Scratch.Set "dateformat" nil }}
<a class="item-link" href="{{ .RelPermalink }}">
<span class="item-title">{{ .Title }}</span>
{{ if not .Date.IsZero }}
<span class="item-day">{{ .Date.Format $dateformat }}</span>
{{ end }}
</a>
<small class="item-details">{{ partial "content-details.html" . }}</small>
<!-- TODO: Only show summary on hover? -->
<p class="item-summary">{{ partial "summary.html" . }}</p>