From 7ef69b2c94318d85e85a160d9efbdb9668bc8c61 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Wed, 20 Jul 2022 13:18:29 -0700 Subject: [PATCH] Add support for hidden posts See https://discourse.gohugo.io/t/custom-pagination-is-not-working/39049/8?u=elnudev --- layouts/partials/header.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 2aa0e74..b367c6a 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1 +1,10 @@ -{{ if and .IsHome (eq .Paginator.PageNumber 1) }}{{ .Site.Params.HomepageHeader | safeHTML }}{{ else }}« Home{{ end }} +{{- $pagination := "" }} +{{- if .IsHome }} +{{ $pagination = .Paginate (where .Site.RegularPages "Params.hidden" "!=" true) }} +{{- end }} + +{{ if and .IsHome (eq $pagination.PageNumber 1) }} +{{ .Site.Params.HomepageHeader | safeHTML }} +{{ else }} +« Home +{{ end }}