In index.html
we have this code
{{ $headless := .Site.GetPage "/homepage" }}
{{ $reusablePages := $headless.Resources.ByType "page" }}
{{ $reusablePages := sort $reusablePages ".Params.weight" }}
{{ range first 1 $reusablePages }}
... HTML to render
{{ end }}
which will render the first page in $reusablePages
. It works well when testing with hugo server
. However, when adding the draft: true
to the frontmatter of the accompanying markdown file, I expect this to not actually render any content. However, it renders the HTML, leaving {{ .Title }}
rendered as well as an <a>
tag with the permalink to the page.
Is there something I need to do when getting the reusable pages to prevent grabbing draft content?
Note - this also happens with the date
front matter set in the future
Note - occurs in hugo build
as well