Closed josephborg closed 3 years ago
Not sure but did you tried to indent under main ??
menus:
main:
- identifier: about
name: about hugo
pre: <i class='fa fa-heart'></i>
url: /about/
weight: -110
- name: getting started
post: <span class='alert'>New!</span>
pre: <i class='fa fa-road'></i>
url: /getting-started/
weight: -100
See your original post, and my response, here: https://discourse.gohugo.io/t/cannot-get-hugo-to-cast-menu-maps/29136
I tried in json format and myriad indentations. it borks even on a simple declaration menus: [ "main", "footer" ]
.
I'll try again. this thing has me pulling my hair at this point. Seems like a simple issue and I'm blaming myself for some fundamental misunderstanding.
Not sure but did you tried to indent under main ??
menus: main: - identifier: about name: about hugo pre: <i class='fa fa-heart'></i> url: /about/ weight: -110 - name: getting started post: <span class='alert'>New!</span> pre: <i class='fa fa-road'></i> url: /getting-started/ weight: -100
I'm not sure about your suggestion. it's not very clear to me. I have tried adding the menus directive to config.yaml
and menus.yaml
and menus.en.yaml
. The error messages around data files in general are quite cryptic for a first time hugo user. For example, in json it borks immediately for a stray comma at the end of a list.
See your original post, and my response, here:
https://discourse.gohugo.io/t/cannot-get-hugo-to-cast-menu-maps/29136
installed a ready made theme with menus and it works. Problem lies between keyboard and seat apparently
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
yes
Issue
I tried adding site-wide menus in
.config
. Hugo serve barfs with errors when a menu map is called from layouts, templates or partials. I'm adding an example from the documentation:menus.yaml
example layout:
error message from
hugo serve
:I'm assuming there are no stupid errors on my side. Advice solicited.