From 1ffa9d1502516ccb8d30674fc51b29935748dea1 Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Sun, 20 Dec 2015 16:21:53 +0100 Subject: Hide categories and tags from homepage if we don't have any Closes #9 --- layouts/partials/homepage.html | 12 ++++++++++-- 1 file 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 }} +{{ with .Site.Taxonomies.categories }} +

Categories

- {{ range $name, $value := .Site.Taxonomies.categories }} + {{ range $name, $value := . }}

{{ title $name }} ({{ .Count }}) @@ -22,10 +24,14 @@ {{ end }}

+{{ end }} + +{{ with .Site.Taxonomies.tags }} +

Tags

- {{ range $name, $value := .Site.Taxonomies.tags }} + {{ range $name, $value := . }} {{ $name }} ({{ .Count }}) @@ -33,4 +39,6 @@ {{ end }}
+{{ end }} + -- cgit v1.2.3