From f7d02ea440684931b68b18011f9de75d800f09f2 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Fri, 27 May 2022 16:24:27 +0200 Subject: Do not show "Latest Publications" if there are no publications --- layouts/_default/list.json.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'layouts/_default/list.json.json') diff --git a/layouts/_default/list.json.json b/layouts/_default/list.json.json index bfcb852..308bd96 100644 --- a/layouts/_default/list.json.json +++ b/layouts/_default/list.json.json @@ -3,7 +3,8 @@ {{- $pages := slice -}} {{- if $.IsHome -}} - {{- $pages = where $pctx.RegularPages.ByDate.Reverse "Type" "in" site.Params.mainSections -}} + {{- $mainSections := site.Params.mainSections | default (slice "post") }} + {{- $pages = where $pctx.RegularPages.ByDate.Reverse "Type" "in" $mainSections -}} {{- else if $.IsSection -}} {{- $pages = $pctx.RegularPages.ByDate.Reverse -}} {{- else -}} -- cgit v1.2.3