LoveIt/layouts/taxonomy/terms.html

52 lines
2.1 KiB
HTML
Raw Normal View History

2019-08-24 13:32:41 +02:00
{{ define "title" }}{{ T "all" }}{{ T .Data.Plural | default (humanize .Data.Plural) }} | {{ .Site.Title }}{{ end }}
2019-08-04 15:53:35 +02:00
{{ define "content" }}
{{ $taxonomies := .Data.Plural }}
2019-08-04 15:53:35 +02:00
{{ $terms := .Data.Terms.ByCount }}
{{ $type := .Type }}
2019-08-18 19:36:52 +02:00
<div class="post-warp archive">
2019-08-24 13:32:41 +02:00
<h2 class="post-title animated pulse faster">
{{- printf "%s%s" (T "all") (T $taxonomies | default (humanize $taxonomies)) -}}
2019-08-04 15:53:35 +02:00
</h2>
<!-- Categories Page -->
{{ if eq $taxonomies "categories" }}
2019-08-04 15:53:35 +02:00
<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 }}">
2019-08-19 17:24:29 +02:00
<h3><i class="far fa-folder"></i>&nbsp;{{ $term | humanize}}</h3>
2019-08-04 15:53:35 +02:00
</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" }}
2019-08-04 15:53:35 +02:00
<div class="tag-cloud-tags">
{{ range $.Site.Taxonomies.tags.ByCount }}
2019-08-19 17:00:26 +02:00
<a href="{{ .Page.Permalink }}"> {{ .Page.Title }} <small>({{ .Count }})</small></a>
2019-08-04 15:53:35 +02:00
{{end}}
</div>
{{ end }}
</div>
{{end }}