Honor draft status of pages

This commit is contained in:
Stefan Rakel 2021-10-22 13:14:13 +02:00 committed by GitHub
parent 6388e9e916
commit 02ed647083
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,13 @@
{{ define "main" }}
{{ $headless := .Site.GetPage "/homepage" }}
{{ $sections := $headless.Resources.ByType "page" }}
{{ $scratch := newScratch }}
{{ $scratch.Set "sections" $sections }}
{{ if not .Site.BuildDrafts }}
{{ $sections := where $sections "Draft" "!=" true}}
{{ $scratch.Set "sections" $sections }}
{{ end}}
{{ $sections := $scratch.Get "sections" }}
<header id="site-head" {{ with .Params.header_image }}style="background-image: url({{ . }})"{{ end }}>
<div class="vertical">
<div id="site-head-content" class="inner">