LoveIt/layouts/taxonomy/terms.html

51 lines
2.1 KiB
HTML

{{ define "title" }}{{ T .Data.Plural | default (humanize .Data.Plural) }} | {{ .Site.Title }}{{ end }}
{{ define "content" }}
{{ $taxonomies := .Data.Plural }}
{{ $terms := .Data.Terms.ByCount }}
{{ $type := .Type }}
<div class="post-warp archive">
<h2 class="post-title">
{{- printf "%s%s" (T "all") (T $taxonomies | default (humanize $taxonomies)) -}}
</h2>
<!-- Categories Page -->
{{ if eq $taxonomies "categories" }}
<div class="categories-card">
{{ range $terms }}
{{ $term := .Term }}
{{ $pages := .Pages }}
{{ with $.Site.GetPage "taxonomy" (printf "%s/%s" $type $term) }}
<div class="card-item">
<div class="categories">
<a href="{{ .Permalink }}">
<h3><i class="far fa-folder"></i>&nbsp;{{ $term | humanize}}</h3>
</a>
{{ range first 5 $pages }}
<article class="archive-item">
<a href="{{ .Permalink }}" class="archive-item-link">{{ .Title }}</a>
</article>
{{ end }}
{{ if gt (len $pages) 5 }}
<span class="more-post">
<a href="{{ .Permalink }}" class="more-post-link">{{ T "More" }} >></a>
</span>
{{ end }}
</div>
</div>
{{ end }}
{{ end }}
</div>
<!-- Tag Cloud Page -->
{{ else if eq $taxonomies "tags" }}
<div class="tag-cloud-tags">
{{ range $.Site.Taxonomies.tags.ByCount }}
<a href="{{ .Page.Permalink }}"> {{ .Page.Title }} <small>({{ .Count }})</small></a>
{{end}}
</div>
{{ end }}
</div>
{{end }}