From 0587cd280324c52c3f7ac6962f38232f49fb5c35 Mon Sep 17 00:00:00 2001 From: Gabriele Musco Date: Sat, 26 Mar 2022 12:18:03 +0100 Subject: [PATCH] dont show articles in posts list if section is empty --- layouts/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/index.html b/layouts/index.html index c51291a..9229957 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -2,7 +2,7 @@ {{/* get all the pages that are regular posts and not pages */}} {{ $postsDir := .Site.Params.Posts | default (slice "posts" "post") }} - {{ $allPostsList := where site.RegularPages "Section" "in" $postsDir }} + {{ $allPostsList := where (where site.RegularPages "Section" "in" $postsDir) "Section" "!=" "" }} {{- partial "showcase.html" . -}} {{- partial "home_post_list.html" (dict "Ctx" . "AllPostsList" $allPostsList) -}}