summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-03-04 10:11:18 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2017-03-04 10:11:18 +0100
commit73cc1f5e48719100c57126dc0956fea02d3d294e (patch)
tree5071d35a5de12cb6fc27a9d4f6c8ca2a51c8e2fe /themes
parentd44b6587373640991d97404b5aca9df28d3eec21 (diff)
downloadwww-andreasbaumann-cc-73cc1f5e48719100c57126dc0956fea02d3d294e.tar.gz
www-andreasbaumann-cc-73cc1f5e48719100c57126dc0956fea02d3d294e.tar.bz2
fixed category tag cloud
Diffstat (limited to 'themes')
-rw-r--r--themes/new_theme/layouts/taxonomy/category.terms.html28
1 files changed, 25 insertions, 3 deletions
diff --git a/themes/new_theme/layouts/taxonomy/category.terms.html b/themes/new_theme/layouts/taxonomy/category.terms.html
index 664a1b8..a774bae 100644
--- a/themes/new_theme/layouts/taxonomy/category.terms.html
+++ b/themes/new_theme/layouts/taxonomy/category.terms.html
@@ -4,12 +4,34 @@
<div>
<h1 id="title">{{ .Title }}</h1>
- <ul>
+ <ol class='tag-cloud'>
{{ $data := .Data }}
{{ range $key, $value := .Data.Terms }}
- <li><a href="/{{ $data.Plural }}/{{ $key | urlize }}">{{ $key }}</a> {{ len $value }}</li>
+ {{ $class := "non-popular" }}
+ {{ if gt ( len $value ) 0 }}
+ {{ $class := "not-very-popular" }}
+ {{ end }}
+ {{ if gt ( len $value ) 1 }}
+ {{ $class := "somewhat-popular" }}
+ {{ end }}
+ {{ if gt ( len $value ) 5 }}
+ {{ $class := "popular" }}
+ {{ end }}
+ {{ if gt ( len $value ) 10 }}
+ {{ $class := "very-popular" }}
+ {{ end }}
+ {{ if gt ( len $value ) 15 }}
+ {{ $class := "ultra-popular" }}
+ {{ end }}
+ <li class='{{ $class }}'>
+ <span>
+ {{ len $value }} blog articles are tagged with
+ </span>
+ <a href="/{{ $data.Plural }}/{{ $key | urlize }}">{{ $key }}</a>
+ </span>
+ </li>
{{ end }}
- </ul>
+ </ol>
</div>
</section>