Hugo-theme-stack/layouts/partials/widget/categories.html
Felix Niederwanger e22664be13
feat(widget): add category widget (#475)
* Add category widget

Adds the ability to add a category to the widgets.

* Adapt to new widget scheme

Co-authored-by: Jimmy Cai <github@jimmycai.com>
2022-03-03 23:47:10 +01:00

17 lines
563 B
HTML

{{- $context := .Context -}}
{{- $limit := default 10 .Params.limit -}}
<section class="widget tagCloud">
<div class="widget-icon">
{{ partial "helper/icon" "categories" }}
</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>