home-info: handle case where home-info was hidden

when num of posts = 0
This commit is contained in:
Aditya Telange 2020-09-17 16:12:07 +05:30
parent 2eef3fcc12
commit ce408f6afc
No known key found for this signature in database
GPG Key ID: 82E844EF3DA99E77
1 changed files with 6 additions and 5 deletions

View File

@ -10,11 +10,14 @@
</header> </header>
{{ end }} {{ end }}
{{ $pages := .RegularPages }} {{ $pages := .RegularPages }}
{{ if .IsHome }} {{ if .IsHome }}
{{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }} {{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
{{- if .Site.Params.homeInfoParams }}
{{- partial "homeInfo.html" . }}
{{- end }}
{{end}} {{end}}
{{ $paginator := .Paginate $pages }} {{ $paginator := .Paginate $pages }}
@ -23,11 +26,9 @@
{{- $class := "post-entry" }} {{- $class := "post-entry" }}
{{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0)) }} {{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0)) }}
{{- if .Site.Params.homeInfoParams | or .Site.Params.disableSpecial1stPost}} {{- if not .Site.Params.homeInfoParams | or .Site.Params.disableSpecial1stPost}}
{{- partial "homeInfo.html" . }}
{{else}}
{{- $class = "first-entry" }} {{- $class = "first-entry" }}
{{ end }} {{- end }}
{{- else if .Data.Term }} {{- else if .Data.Term }}
{{- $class = "post-entry tag-entry" }} {{- $class = "post-entry tag-entry" }}
{{- end }} {{- end }}