summaryrefslogtreecommitdiffstats
path: root/layouts/_default
diff options
context:
space:
mode:
authorSerghei Iakovlev <egrep@protonmail.ch>2022-07-20 01:14:33 +0200
committerSerghei Iakovlev <egrep@protonmail.ch>2022-07-20 01:15:12 +0200
commitab789fc20396bb583835c1f47478c1f17039d39f (patch)
treec7c62acff7f2d404b5121807e78a2de3a94dc226 /layouts/_default
parentd6736498de8885d446622dcafebeff033bc7b8c0 (diff)
downloadgohugo-theme-ed-ab789fc20396bb583835c1f47478c1f17039d39f.tar.gz
Provide minimal tag cloud
Diffstat (limited to 'layouts/_default')
-rw-r--r--layouts/_default/list.html1
-rw-r--r--layouts/_default/term.html1
-rw-r--r--layouts/_default/terms.html29
3 files changed, 31 insertions, 0 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 85e8a43..2fd13ba 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -1,5 +1,6 @@
{{ define "main" }}
+{{/* This template is for list of all publications in a Section */}}
<div class="articles">
{{ with .Title }}<h1 class="page-title">{{ . }}</h1>{{ end }}
diff --git a/layouts/_default/term.html b/layouts/_default/term.html
index 03430d4..6450775 100644
--- a/layouts/_default/term.html
+++ b/layouts/_default/term.html
@@ -1,5 +1,6 @@
{{ define "main" }}
+{{/* This template is for list of all publications in a Term (for example a Tag) */}}
<div class="articles">
<h1 class="page-title">
{{ with .Title }}{{ i18n "publications_tagged" . }}{{ end }}
diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html
new file mode 100644
index 0000000..20e8f29
--- /dev/null
+++ b/layouts/_default/terms.html
@@ -0,0 +1,29 @@
+{{ define "main" }}
+
+{{/* This template is for list of all Tags */}}
+<div class="articles">
+ <h1 class="page-title">
+ {{ with .Title }}
+ {{ i18n "tag_cloud" . }}
+ {{ end }}
+ </h1>
+
+ {{ $tags := site.Taxonomies.tags.ByCount }}
+
+ <div class="tags-wrapper">
+ <ul class="tags-cloud">
+ {{ range uniq $tags }}
+ {{ if .Term }}
+ {{ $tagURL := printf "tags/%s" .Term | relURL }}
+ <li class="tag">
+ <a class="tag-link" href="{{ $tagURL }}">
+ {{ .Term }} ({{ .Count }})
+ </a>
+ </li>
+ {{ end }}
+ {{ end }}
+ </ul>
+ </div>
+</div>
+
+{{ end }}