www-from-model/layouts/_partials/taxonomy-list-grid.html
Stephan Heunis 4200cca249
Some checks failed
Deploy on webserver / Build site and deploy on success (push) Failing after 1m40s
add taxonomy-flavoured meerkat placeholder images for grid layout
2026-06-02 09:57:57 +02:00

42 lines
No EOL
1.6 KiB
HTML

{{ $currentTaxonomy := .Data.Plural }}
{{ $singleTerm := .Data.Singular }}
{{ $includeItems := .Params.items | default "generated" }}
{{ $depictionType := default "depiction" (index .Params "term" "depiction_type") }}
{{ $meerkatPath := (print "img/meerkat_" $singleTerm ".png")}}
<section class="items-grid">
{{ range .Pages }}
{{ if or (ne $includeItems "generated") .Params.title }}
{{ $count := 0 }}
{{ $key := .Data.Term }}
{{ with index $.Data.Terms $key }}
{{ $count = .Count }}
{{ end }}
{{ $depictions := .Resources.Match (print $depictionType ".*") }}
<a class="item-card"
href="{{ .Permalink }}">
<div class="item-depiction">
{{ with index $depictions 0 }}
{{ if eq .MediaType.SubType "svg" }}
<img src="{{ .RelPermalink }}" style="margin: 0;" alt="{{ .Title }}">
{{ else }}
<img src="{{ (.Fill "300x300 Top").RelPermalink }}" alt="{{ .Title }}">
{{ end }}
{{ else }}
{{ with resources.Get $meerkatPath }}
{{ $img := .Fill "300x300 Top" }}
<img src="{{ $img.RelPermalink }}" alt="{{ .Title }}" style="opacity: 0.5;">
{{ else }}
<div class="item-placeholder">
<span>{{ substr .Title 0 1 }}</span>
</div>
{{ end }}
{{ end }}
</div>
<div class="item-title">
{{ .Title }} ({{ $count }})
</div>
</a>
{{ end }}
{{ end }}
</section>
<link rel="stylesheet" href="/grid-list.css">