Repository: gohugoio/hugo

Issue #11809: Don't make draft/future/expired pages of branch nodes recursively disabled
Created: 2023-12-17T17:03:16Z
This will be a breaking change for some, but it's meant well -- the current behaviour of special handling taxonomy pages is confusing and less flexible than it could be.
Currently, when we draft a taxonomy page (or e.g. mark it to be published in the future or it's expired):
categories/_index.md:
---
title: "The Categories"
draft: true
---

Content.
We hide the entire tree from /categories and down.
The original intent/semantics of draft was to delay publishing of that particular page/content, so with this change we make kind=taxonomy work the same as sections. So, we say:

For regular pages (leaf nodes) and term pages, the Page it's just removed/ignored.
For home, section, taxonomy

we keep the Page node to make the page tree fully navigable.
the Page is not rendered and not in any page collection.
but you can reach it with site.GetPage (and the taxonomy in site.Taxonomies).

Duplicate issue #11441: Draft _index.md gives "invalid memory address or nil pointer dereference"
Created: 2023-09-10T02:01:24Z
What version of Hugo are you using?
hugo v0.118.2-da7983ac4b94d97d776d7c2405040de97e95c03d+extended windows/amd64 BuildDate=2023-08-31T11:23:51Z VendorInfo=gohugoio

Does this issue reproduce with the latest release?
Yes
Summary
When I use a draft _index.md at the root level I get:

invalid memory address or nil pointer dereference

The error goes away if I change draft to false for _index.md.
Repro
hugo new site foo
cd foo
git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
echo "theme = 'ananke'" >> hugo.toml
hugo new _index.md
hugo server
Final output:
Error: error building site:
render: render of "404" failed: "C:\foo\themes\ananke\layouts\404.html:1:24":
execute of template failed: template: 404.html:1:24:
executing "header" at <partial "page-header.html" .>:
error calling partial: "C:\foo\themes\ananke\layouts\partials\page-header.html:22:9":
execute of template failed: template: partials/page-header.html:22:9:
executing "partials/page-header.html" at <partial "site-navigation.html" .>:
error calling partial: "C:\foo\themes\ananke\layouts\partials\site-navigation.html:3:21":
execute of template failed: template: partials/site-navigation.html:3:21:
executing "partials/site-navigation.html" at <.Site.Home.RelPermalink>:
error calling RelPermalink:
runtime error: invalid memory address or nil pointer dereference

Other themes
Same error from different file/lines.
PaperMod:
Error: error building site:
render: render of "404" failed: "C:\foo\themes\PaperMod\layouts\_default\baseof.html:16:8":
execute of template failed: template: 404.html:16:8:
executing "404.html" at <partialCached "header.html" . .Page>:
error calling partialCached: "C:\foo\themes\PaperMod\layouts\partials\header.html:101:29":
execute of template failed: template: partials/header.html:101:29:
executing "partials/header.html" at <site.Home.AllTranslations>:
error calling AllTranslations:
runtime error: invalid memory address or nil pointer dereference

Blowfish:
Error: error building site: render: render of "404" failed: "C:\foo\themes\Blowfish\layouts\_default\baseof.html:20:5":
execute of template failed: template: 404.html:20:5:
executing "404.html" at <partial $header .>:
error calling partial: "C:\foo\themes\Blowfish\layouts\partials\header\basic.html:21:30":
execute of template failed: template: partials/header/basic.html:21:30:
executing "partials/header/basic.html" at <markdownify>:
error calling markdownify: runtime error: invalid memory address or nil pointer dereference

Closing comment (2024-01-18T04:11:32Z): Closing as duplicate of #11809.