From f1c6ef3c51f846636ac91dd0f1c8b989a6334666 Mon Sep 17 00:00:00 2001 From: RanKKI Date: Wed, 9 Dec 2020 17:34:48 +0800 Subject: [PATCH] hide taxonomies if taxononmies are disabled in config --- README.md | 2 ++ layouts/index.html | 2 ++ layouts/posts/single.html | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5ec2b404..b9fabf87 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,8 @@ weight = 4 * show all posts ```toml +paginate = 15 # 15 posts per page + [params] showAllPostsOnHomePage = true postsOnHomePage = 5 # this option will be ignored diff --git a/layouts/index.html b/layouts/index.html index 0c0db709..33269875 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -38,6 +38,7 @@
Writings + {{ if ne (len .Site.Taxonomies) 0 }} {{ if (and (and (isset .Site.Params "tagsoverview") (eq .Site.Params.tagsOverview true)) (gt (len .Site.Taxonomies.tags) 0)) }} Topics @@ -50,6 +51,7 @@ Most recent {{ end }} + {{ end }} {{ $showAllPostsOnHomePage := false }} {{ if (isset .Site.Params "showallpostsonhomepage") }} diff --git a/layouts/posts/single.html b/layouts/posts/single.html index d2b60425..44c1461c 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -30,7 +30,7 @@

(Updated: ) {{ end }} - {{ if gt .Params.categories 0 }} + {{ if (and (isset .Site.Taxonomies "categories") (gt .Params.categories 0)) }} {{ end }} - {{ if gt .Params.tags 0 }} + {{ if (and (isset .Site.Taxonomies "tags") (gt .Params.tags 0)) }}