Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CaiJimmy/hugo-theme-stack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Niederwanger <felix.niederwanger@suse.com>2022-03-04 01:47:10 +0300
committerGitHub <noreply@github.com>2022-03-04 01:47:10 +0300
commite22664be13a89b7e0401c3652340569316bb417e (patch)
treede714d7fd47a8793191cb0f2fa2be0c66ce898ce /layouts
parentd806226ec8d1f7eb0a0596609bfcc143785f7f55 (diff)
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>
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/widget/categories.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/layouts/partials/widget/categories.html b/layouts/partials/widget/categories.html
new file mode 100644
index 0000000..10c8a35
--- /dev/null
+++ b/layouts/partials/widget/categories.html
@@ -0,0 +1,16 @@
+{{- $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>