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

Hugo 1.8 breaks header.html partial menu logic #18

Closed
ethanmad opened this issue Jan 3, 2017 · 7 comments · Fixed by #19
Closed

Hugo 1.8 breaks header.html partial menu logic #18

ethanmad opened this issue Jan 3, 2017 · 7 comments · Fixed by #19
Assignees

Comments

@ethanmad
Copy link

ethanmad commented Jan 3, 2017

Everything worked perfectly with Hugo versions <= 1.7, but the menu does not populate anymore.

Everything from hugo-theme-bootie-docs/layouts/partials/header.html line 36 to line 52 appears to now be broken under Hugo 1.8.

My theme is similar enough and experiences this problem, too. In my site's config.toml, I have defined noCategoryLink and have a mainMenu array, yet now I get only a 'Home' and a 'Categories' link in the menu. (I want all of the pages defined in the params.mainMenu to show up and I don't want Categories.)

If you build your site with the latest version of Hugo, you should also experience this

I'm not sure which change in Hugo 1.8 (changelog) caused this problem, but I'd be happy to work on this with you.

@key-amb key-amb self-assigned this Jan 4, 2017
@key-amb
Copy link
Collaborator

key-amb commented Jan 4, 2017

Thank you for your report.
Though I'm not sure about what causes this, I'll check it soon.

@key-amb
Copy link
Collaborator

key-amb commented Jan 7, 2017

I confirmed this problem.

Hugo changed its behavior at v0.18 https://github.com/spf13/hugo/releases/tag/v0.18

Here they say:

All the Params configurations are now case insensitive #1129 #2590 #2615

And the document on gohugo.io says now:

All Params are only accessible using all lowercase characters.

So it seems that we have to change all variables in config.toml into lowercase.
I'll do this.

@ethanmad
Copy link
Author

ethanmad commented Jan 7, 2017 via email

@key-amb
Copy link
Collaborator

key-amb commented Jan 7, 2017

Oh, I misunderstood one thing.
bep fixed this problem by gohugoio/hugo#2717

And we can access by {{ .Site.Params.mainMenu }} instead of {{ .Site.Params "mainMenu" }} .

So we don't need to change config variables into lowercase. Just do above.
I'll do this.

Thanks,

@key-amb
Copy link
Collaborator

key-amb commented Jan 7, 2017

I opened a topic in Hugo's discussion forum: https://discuss.gohugo.io/t/config-params-should-be-all-lowercase-or-not/5051/1 to ask a recommended way to solve this problem just in case.

@ethanmad
Copy link
Author

ethanmad commented Jan 9, 2017

I guess we found a bug in Hugo together! Thanks for doing the research and posting on the discussion forum.

@ethanmad
Copy link
Author

ethanmad commented Jan 9, 2017

Upstream issue: gohugoio/hugo#2907.

key-amb added a commit that referenced this issue Jan 10, 2017
Fix #18 / .Site.Params "fooBar" is not accessible for Hugo v0.18
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

Successfully merging a pull request may close this issue.

2 participants