-
Notifications
You must be signed in to change notification settings - Fork 61
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
Error when no menu items are set in config file #165
Comments
I'd like to have a crack at this. Where in the code does this check need to happen? I am asking because I want to add different menu items, so I will be happy to mess with menu stuff for a bit. |
The code to fix is here: https://github.com/mattstratton/castanet/blob/master/layouts/partials/header.html#L11 Basically, we need to wrap the whole menu part with a query that does a range of
|
@mattstratton - Think it would be something like this.. {{ if ge (len .Site.Menus.main) 1 }} Happy to include it in one of my PRs and test, if useful? |
Also, I guess this is a bug rather than enhancement :) |
I think this looks like the right test. I would put it in as a separate PR though rather than pushing it with another one, just to keep it cleaner. |
Fixed in #371 |
Currently, if no menu is set, the theme will error out. Should add a check to ensure there are menu items before trying to display them.
The text was updated successfully, but these errors were encountered: