changed tags list style, hiding date and sorting alphabetically

This commit is contained in:
Gabriele Musco 2021-06-16 10:57:46 +02:00
parent 8d1905bd07
commit 6f8e3cfdb4
No known key found for this signature in database
GPG Key ID: 8539FD3454380B83
1 changed files with 15 additions and 2 deletions

View File

@ -7,7 +7,20 @@
{{ if and (eq $section "Tags") (ne $section $title) }}Tag: #{{ end }}{{ $title }} {{ if and (eq $section "Tags") (ne $section $title) }}Tag: #{{ end }}{{ $title }}
</h2> </h2>
<ul class="list"> <ul class="list">
{{ range .Pages }} {{ if and (eq $section "Tags") (eq $section $title) }}
<li><span class="date">{{ .Date.Format "2006-01-02" }}</span> <a href="{{ .Permalink }}">{{ .Title }}</a></li> {{/* if we're in the Tags section, sort alphabetically and don't show the date */}}
{{ range (sort .Pages "Title") }}
<li>
<a href="{{ .Permalink }}">#{{ .Title }}</a>
</li>
{{ end }}
{{ else }}
{{ range .Pages }}
<li>
<span class="date">
{{ .Date.Format "2006-01-02" }}
</span> <a href="{{ .Permalink }}">{{ .Title }}</a>
</li>
{{ end }}
{{ end }} {{ end }}
</ul> </ul>