From ce408f6afc0c7ae083ffa48c86b8ce8147c2dda1 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Thu, 17 Sep 2020 16:12:07 +0530 Subject: [PATCH] home-info: handle case where home-info was hidden when num of posts = 0 --- layouts/_default/list.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index c0016be1..009d0749 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -10,11 +10,14 @@ {{ end }} - {{ $pages := .RegularPages }} {{ if .IsHome }} {{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }} + +{{- if .Site.Params.homeInfoParams }} +{{- partial "homeInfo.html" . }} +{{- end }} {{end}} {{ $paginator := .Paginate $pages }} @@ -23,11 +26,9 @@ {{- $class := "post-entry" }} {{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0)) }} -{{- if .Site.Params.homeInfoParams | or .Site.Params.disableSpecial1stPost}} -{{- partial "homeInfo.html" . }} -{{else}} +{{- if not .Site.Params.homeInfoParams | or .Site.Params.disableSpecial1stPost}} {{- $class = "first-entry" }} -{{ end }} +{{- end }} {{- else if .Data.Term }} {{- $class = "post-entry tag-entry" }} {{- end }}