dont show articles in posts list if section is empty

This commit is contained in:
Gabriele Musco 2022-03-26 12:18:03 +01:00
parent 603a9f6d6e
commit 0587cd2803
No known key found for this signature in database
GPG Key ID: 0587A5D65B5DC99E
1 changed files with 1 additions and 1 deletions

View File

@ -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) -}}