vjeantet/hugo-theme-docdock

issues building doc since Hugo v0.50

Closed this issue · 8 comments

i4o commented

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

i4o commented

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

pauby commented

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?

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?

We already have submit PR for those fix.

See #167 & #168

pauby commented

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.

This is fixed with #168 and backwards compatible.

Tested with hugo-extended v0.49.2, v0.50 and v0.51