panr / hugo-theme-terminal

A simple, retro theme for Hugo
MIT License
1.96k stars 737 forks source link

When defining additional menus in config, menu.html and mobile-menu.html has errors #433

Closed grayside closed 2 weeks ago

grayside commented 1 year ago

When additional menus are defined, the menu templates have errors.

Example of error:

execute of template failed: template: partials/menu.html:4:16: executing "partials/menu.html" at <first $.Site.Params.showMenuItems $.Site.Menus.main>: error calling first: both limit and seq must be provided

Proposed Solution

My workaround is to wrap the full definition of each template in a conditional:

{{- if $.Site.Menus.main }}
...
{{ end -}}