LoveIt/layouts/taxonomy/terms.html

52 lines
2.1 KiB
HTML
Raw Normal View History

{{ define "title" }}{{ T "all" | humanize}}{{ T .Data.Plural | default .Data.Plural | humanize }} | {{ .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 }}
2020-01-31 11:46:28 +01:00
<div class="warpper archive">
2019-08-24 13:32:41 +02:00
<h2 class="post-title animated pulse faster">
{{ T "all" | humanize}}{{ T $taxonomies | default $taxonomies | humanize }}
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 }}">
<h3><i class="far fa-folder fa-fw"></i>{{ $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">
2020-01-30 06:17:42 +01:00
<a href="{{ .Permalink }}" class="more-post-link">{{ T "more" }} >></a>
2019-08-04 15:53:35 +02:00
</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 }}