gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
75.38k stars 7.49k forks source link

Panic with hugo new when archetype accesses .Site and target section has draft = true #9196

Closed jmooring closed 8 months ago

jmooring commented 2 years ago

hugo v0.89.4-AB01BA6E+extended linux/amd64 BuildDate=2021-11-17T08:24:09Z VendorInfo=gohugoio

panic: [BUG] no Page found for ...

archetypes/default.md

+++
title = '{{ replace .Name "-" " " | title }}'
date = {{ .Date }}
draft = false
+++
{{ .Site.Title }}

structure

content/
└── test/
    └── _index.md

content/test/_index.md

+++
title = 'Tests'
date = 2021-11-21T17:33:19-08:00
draft = true
+++

command

hugo new test/foo.md

This was introduced in v0.89.0.

MRE:

git clone --single-branch -b hugo-github-issue-9196 https://github.com/jmooring/hugo-testing hugo-github-issue-9196
cd hugo-github-issue-9196
hugo new test/foo.md

Reference: https://discourse.gohugo.io/t/35677/

jmooring commented 8 months ago

This is fixed in v0.123.0.

github-actions[bot] commented 7 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.