issues building doc since Hugo v0.50
Closed this issue · 8 comments
Multiple identical error messages:
error calling partial: "/builds/dev/doc/themes/hugo-theme-docdock/layouts/partials/header.html:2:10": execute of template failed: template: partials/header.html:2:10: executing "partials/header.html" at <where .Site.Pages "S...>: error calling where: Source isn't a field of struct type *hugolib.Page
Just for reference,this is how header.html looks like:
{{ $header := print "_header." .Lang }}
{{ range where .Site.Pages "Source.BaseFileName" $header }}
{{ .Content }}
{{else}}
{{ if .Site.GetPage "page" "_header.md" }}
{{(.Site.GetPage "page" "_header.md").Content}}
{{else}}
<a class="baselink" href="{{.Site.BaseURL}}">{{.Site.Title}}</a>
{{end}}
{{end}}
Mmmmm seems they changed the Page variable somehow ...
{{ range where .Site.Pages ".File.BaseFileName" $header }}
seems to solve the problem. I have to really check but seems ok. Let me know how it works on your side.
Source
is really badly documented and I guess not for use in code.
Looks like Source was removed in 0.50
gohugoio/hugo@7930d21
I had to replace {{ range where .Site.Pages "Source.BaseFileName" $footer }}
with {{ range where .Site.Pages ".File.BaseFileName" $footer }}
as well has in header.html
Can we get an update out with these fixes asap?
Awesome (I missed those previously). Hopefully they will get pulled in and released asap.
Hi,
I will test the changes with different Hugo versions and if everything fine, then will merge in PR this evening.