Redesign list layout

This commit is contained in:
ItsDrike 2022-05-11 14:04:08 +02:00
parent 75a45a192b
commit f3419a37b1
No known key found for this signature in database
GPG key ID: B014E761034AF742
5 changed files with 122 additions and 40 deletions

View file

@ -1,9 +1,18 @@
<div class="media list-page-item mb-3" data-id="{{ with .File}}{{ .File.UniqueID }}{{ end }}">
<div class="media-body">
<a href="{{ .RelPermalink }}">
<h5 class="my-0">{{ .Title }}</h5>
</a>
<small>{{ partial "content-details.html" . }}</small>
<p>{{ partial "summary.html" . }}</p>
</div>
</div>
<!-- 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>