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

github.com/htdvisser/hugo-base16-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHylke Visser <htdvisser@gmail.com>2015-12-20 18:21:53 +0300
committerHylke Visser <htdvisser@gmail.com>2015-12-20 18:21:53 +0300
commit1ffa9d1502516ccb8d30674fc51b29935748dea1 (patch)
tree9214c93e885f4d76a11c0ed951718c9393ec328c
parentac88db2aecaaf9dd768f53d65947cb5de1d5f460 (diff)
Hide categories and tags from homepage if we don't have any
Closes #9
-rw-r--r--layouts/partials/homepage.html12
1 files changed, 10 insertions, 2 deletions
diff --git a/layouts/partials/homepage.html b/layouts/partials/homepage.html
index ced99ad..69b7090 100644
--- a/layouts/partials/homepage.html
+++ b/layouts/partials/homepage.html
@@ -11,10 +11,12 @@
{{ end }}
</div>
+{{ with .Site.Taxonomies.categories }}
+
<h1 class="headline">Categories</h1>
<section class="categories">
- {{ range $name, $value := .Site.Taxonomies.categories }}
+ {{ range $name, $value := . }}
<h2 class="category">
<a href="{{ $baseurl }}categories/{{ $name | urlize }}">{{ title $name }}</a>
<small>({{ .Count }})</small>
@@ -22,10 +24,14 @@
{{ end }}
</section>
+{{ end }}
+
+{{ with .Site.Taxonomies.tags }}
+
<h1 class="headline">Tags</h1>
<section class="tags">
- {{ range $name, $value := .Site.Taxonomies.tags }}
+ {{ range $name, $value := . }}
<span class="tag">
<a href="{{ $baseurl }}tags/{{ $name | urlize }}">{{ $name }}</a>
<small>({{ .Count }})</small>
@@ -33,4 +39,6 @@
{{ end }}
</section>
+{{ end }}
+
</main>