From f7d555ae80489d53fb84caa1eb767efe6bd6f4d4 Mon Sep 17 00:00:00 2001 From: vimux Date: Sat, 27 Apr 2019 10:55:46 -0400 Subject: [PATCH] Remove empty div.cards when no posts --- layouts/index.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/layouts/index.html b/layouts/index.html index 90b9b32..0c5dcd8 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -5,15 +5,17 @@ {{ with .Content }}
{{ . }}
{{ end }} {{- end }} -
{{- $mainSections := .Site.Params.mainSections }} {{- $paginator := .Paginate (where .Data.Pages "Section" "in" $mainSections) }} - {{- range $paginator.Pages }} -
- {{ .Render "summary" }} + {{- if gt $paginator.TotalNumberOfElements 0 }} +
+ {{- range $paginator.Pages }} +
+ {{ .Render "summary" }} +
+ {{- end }}
{{- end }} -
{{- if and (not .Site.Params.hideNoPostsWarning) (eq $paginator.TotalNumberOfElements 0) }}
¯\_(ツ)_/¯