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/index.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'layouts/index.html') diff --git a/layouts/index.html b/layouts/index.html index f0f88ae..7dde6eb 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,22 +1,27 @@ {{ define "main" }} +{{- $mainSections := site.Params.mainSections | default (slice "post") }} {{- with .Content }}
{{ . }}
+ {{- $section := where site.RegularPages "Section" "in" $mainSections }} + {{- $section_count := len $section }} + {{- if ge $section_count 1 }}
{{/* TODO: Translate me */}}

Latest Publications

+ {{ end }} {{- else }} - {{ $paginator := .Paginate (where site.RegularPages "Type" "in" site.Params.mainSections) }} + {{ $paginator := .Paginate (where site.RegularPages "Section" "in" $mainSections) }}
{{ with .Title }}

{{ . }}

{{ end }} {{ range $paginator.Pages }}{{- .Render "teaser" }}{{ end }} -- cgit v1.2.3