LoveIt/layouts/taxonomy/terms.html

58 lines
2.4 KiB
HTML
Raw Normal View History

2020-01-31 15:53:04 +01:00
{{- define "title" -}}
{{- .Title | default (T .Data.Plural) | default (humanize .Data.Plural) }} | {{ .Site.Title -}}
2020-01-31 15:53:04 +01:00
{{- end -}}
2019-08-04 15:53:35 +02:00
2020-01-31 15:53:04 +01:00
{{- define "content" -}}
{{- $taxonomies := .Data.Plural -}}
{{- $terms := .Data.Terms.ByCount -}}
{{- $type := .Type -}}
2019-08-04 15:53:35 +02:00
<div class="page archive">
{{- /* Title */ -}}
2020-02-13 18:30:33 +01:00
<h2 class="single-title animated pulse faster">
2020-01-31 15:53:04 +01:00
{{- T "all" | humanize}}{{ T $taxonomies | default $taxonomies | humanize -}}
2019-08-04 15:53:35 +02:00
</h2>
{{- /* Categories Page */ -}}
2020-01-31 15:53:04 +01:00
{{- if eq $taxonomies "categories" -}}
2019-08-04 15:53:35 +02:00
<div class="categories-card">
2020-01-31 15:53:04 +01:00
{{- range $terms -}}
{{- $term := .Term -}}
{{- $pages := .Pages -}}
{{- with $.Site.GetPage "taxonomy" (printf "%s/%s" $type $term) -}}
2019-08-04 15:53:35 +02:00
<div class="card-item">
<div class="card-item-wrapper">
<h3 class="card-item-title">
<a href="{{ .RelPermalink }}">
<i class="far fa-folder fa-fw"></i>&nbsp;{{ $term | humanize}}
</a>
</h3>
2020-01-31 15:53:04 +01:00
{{- range first 5 $pages -}}
2019-08-04 15:53:35 +02:00
<article class="archive-item">
<a href="{{ .RelPermalink }}" class="archive-item-link">
2020-01-31 15:53:04 +01:00
{{- .Title -}}
</a>
2019-08-04 15:53:35 +02:00
</article>
2020-01-31 15:53:04 +01:00
{{- end -}}
{{- if gt (len $pages) 5 -}}
2019-08-04 15:53:35 +02:00
<span class="more-post">
<a href="{{ .RelPermalink }}" class="more-single-link">{{ T "more" }} >></a>
2019-08-04 15:53:35 +02:00
</span>
2020-01-31 15:53:04 +01:00
{{- end -}}
2019-08-04 15:53:35 +02:00
</div>
</div>
2020-01-31 15:53:04 +01:00
{{- end -}}
{{- end -}}
2019-08-04 15:53:35 +02:00
</div>
{{- /* Tag Cloud Page */ -}}
2020-01-31 15:53:04 +01:00
{{- else if eq $taxonomies "tags" -}}
2019-08-04 15:53:35 +02:00
<div class="tag-cloud-tags">
2020-01-31 15:53:04 +01:00
{{- range $.Site.Taxonomies.tags.ByCount -}}
<a href="{{ .Page.RelPermalink }}"> {{ .Page.Title }} <small>({{ .Count }})</small></a>
2020-01-31 15:53:04 +01:00
{{- end -}}
2019-08-04 15:53:35 +02:00
</div>
2020-01-31 15:53:04 +01:00
{{- end -}}
2019-08-04 15:53:35 +02:00
</div>
2020-02-06 17:10:00 +01:00
{{- end -}}