mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-02-06 20:03:31 +08:00
User can disable icon using `widgets.[home]page.iconVisible`, and change widget icon using `widgets.[home]page.icon`.
21 lines
728 B
HTML
21 lines
728 B
HTML
{{- $context := .Context -}}
|
|
{{- $limit := default 10 .Params.limit -}}
|
|
<section class="widget tagCloud">
|
|
<div class="widget-icon">
|
|
{{ $icon := default "categories" .Params.icon }}
|
|
{{ $iconVisible := default true .Params.iconVisible }}
|
|
{{ if $iconVisible }}
|
|
{{ partial "helper/icon" $icon }}
|
|
{{ end }}
|
|
</div>
|
|
<h2 class="widget-title section-title">{{ T "widget.categoriesCloud.title" }}</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>
|