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

issues building doc since Hugo v0.50 #166

Closed
i4o opened this issue Oct 29, 2018 · 8 comments
Closed

issues building doc since Hugo v0.50 #166

i4o opened this issue Oct 29, 2018 · 8 comments

Comments

@i4o
Copy link

i4o commented Oct 29, 2018

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
Copy link
Author

i4o commented Oct 29, 2018

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}}

@divinerites
Copy link

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.

@jjhamer
Copy link

jjhamer commented Nov 1, 2018

Looks like Source was removed in 0.50
gohugoio/hugo@7930d21

@pauby
Copy link

pauby commented Nov 6, 2018

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?

@divinerites
Copy link

divinerites commented Nov 6, 2018

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
Copy link

pauby commented Nov 6, 2018

Awesome (I missed those previously). Hopefully they will get pulled in and released asap.

@Pilskalns
Copy link

Hi,

I will test the changes with different Hugo versions and if everything fine, then will merge in PR this evening.

Pilskalns added a commit that referenced this issue Nov 8, 2018
hugo 0.50 compatibility

Solves #166 
Solves #169 
Duplicates #167
@Pilskalns
Copy link

This is fixed with #168 and backwards compatible.

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

rdebeasi added a commit to openpracticelibrary/openpracticelibrary that referenced this issue Nov 27, 2018
FMuro added a commit to FMuro/hugo-theme-lecturenotes that referenced this issue Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants