mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-04-29 03:53:30 +08:00
25 lines
991 B
HTML
25 lines
991 B
HTML
{{- $query := first 1 (where (where .Context.Site.Pages "Kind" "taxonomy") "Type" "categories") -}}
|
|
{{- $context := .Context -}}
|
|
{{- $limit := default 10 .Params.limit -}}
|
|
{{- if $query -}}
|
|
{{- $categoriesPage := index $query 0 -}}
|
|
<section class="widget tagCloud">
|
|
<div class="widget-icon">
|
|
{{ partial "helper/icon" "categories" }}
|
|
</div>
|
|
<h2 class="widget-title section-title">
|
|
<a class="widget-link" href="{{ $categoriesPage.RelPermalink }}">{{ default "Categories" $categoriesPage.Title }}</a>
|
|
</h2>
|
|
|
|
<div class="tagCloud-tags">
|
|
{{ range first $limit $context.Site.Taxonomies.categories.ByCount }}
|
|
<a href="{{ .Page.RelPermalink }}" class="font_size_{{ .Count }}">
|
|
{{ .Page.Title }}
|
|
</a>
|
|
{{ end }}
|
|
</div>
|
|
</section>
|
|
{{- else -}}
|
|
{{- warnf "Categories page not found. Please enable the categories taxonomy." -}}
|
|
{{- end -}}
|