From 435e558193d7d5f2e04b1bfe2295a5070aa14cc9 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Tue, 29 Dec 2020 21:24:31 +0100 Subject: Fixed regression: Category showed up in child pages as well --- scripts/build_content.sh | 5 ++++- templates/base.html | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/build_content.sh b/scripts/build_content.sh index e2b3bb3..12de8c8 100755 --- a/scripts/build_content.sh +++ b/scripts/build_content.sh @@ -94,12 +94,15 @@ get_subpages_meta() { pages=$(echo "{}" | jq ". + { \ all: [], \ - by_year: {} \ + by_year: {}, \ + not_empty: false \ }") if [ ${#child_pages[@]} -ne 0 ]; then #echo -e "\033[0;90m[////////]\033[0m Child pages:" + pages=$(echo "$pages" | jq ".not_empty = true") + for file in "${child_pages[@]}"; do #echo -e "\033[0;90m[////////]\033[0m - $file" diff --git a/templates/base.html b/templates/base.html index 0704388..9574d08 100644 --- a/templates/base.html +++ b/templates/base.html @@ -52,8 +52,10 @@ ${pageHeader()} $body$ $if(section.is_blog)$ - ${categories.blog:categoryRef()} - ${pagelistByYear()} + $if(pages.not_empty)$ + ${categories.blog:categoryRef()} + ${pagelistByYear()} + $endif$ $endif$ -- cgit v1.2.3-70-g09d2