Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.65.0 breaks breadcrumb snippet #6923

Closed
inwardmovement opened this issue Feb 20, 2020 · 4 comments
Closed

v0.65.0 breaks breadcrumb snippet #6923

inwardmovement opened this issue Feb 20, 2020 · 4 comments

Comments

@inwardmovement
Copy link

inwardmovement commented Feb 20, 2020

Versions: 0.65.0 and 0.65.1
It was fine in 0.64.1

Error: Error building site: render of "404" failed: execute of template failed: template: 404.html:9:5: executing "404.html" at <partial "breadcrumb" .>: error calling partial: "...\_repos\algo-website\layouts\partials\breadcrumb.html:10:11": execute of template failed: template: partials/breadcrumb.html:10:11: executing "breadcrumbnav" at <.p1.Parent>: error calling Parent: runtime error: invalid memory address or nil pointer dereference

@karamme
Copy link

karamme commented Feb 20, 2020

To add to this issue, it is not directly related to the breadcrumb snippet. The .Kind 404 will fail when calling several variables like .Parent, .FirstSection, .CurrentSection etc. So even on a clean repo if I use {{ with .Parent }} ... {{end}} in either the 404.html or the baseof.html, it will fail with something like:

Render of "404" failed: "...\layouts\404.html:15:16": execute of template failed: template: 404.html:15:16: executing "404.html" at <.Parent>: error calling Parent: runtime error: invalid memory address or nil pointer dereference

@bep bep added the Bug label Feb 21, 2020
@bep bep added this to the v0.65.2 milestone Feb 21, 2020
@bep
Copy link
Member

bep commented Feb 21, 2020

Fixed by 4c2a0de

@bep bep closed this as completed Feb 21, 2020
@amacaida
Copy link

amacaida commented Oct 3, 2020

Hm, this was marked fixed but I am still getting this error similar to the OP on Hugo 0.75:

Error: Error building site: render of "404" failed: execute of template failed: template: 404.html:64:7: executing "404.html" at <partial "breadcrumb.html" .>: error calling partial: "...\layouts\partials\breadcrumb.html:7:9": execute of template failed: template: partials/breadcrumb.html:7:9: executing "breadcrumbnav" at <.p1.Parent>: error calling Parent: runtime error: invalid memory address or nil pointer dereference

Working around it by modifying the template:

{{ if ne .Kind "404" }}{{ partial "breadcrumb.html" . }}{{ end }}

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants