I have tried to create a menus.yaml file under /config/_default/.
The file is indented 2 spaces and when I run “hugo server” I get the following screen:"
Error: command error: failed to create config from result: failed to decode “menus”: unable to cast maps.Params{“main”:interface {}{map[string]interface {}{“name”:“HOME”, “pageRef”:“home”, “url”:“/”, “weight”:1}, map[string]interface {}{“name”:“Dues”, “pageRef”:“dues”, “url”:“/dues”, “weight”:10}, map[string]interface {}{“name”:“Dues2022”, “pageRef”:“dues2022”, “parent”:“dues”, “url”:“/dues2022”, “weight”:22}, map[string]interface {}{“name”:“Dues2023”, “pageRef”:“dues2023”, “parent”:“dues”, “url”:“/dues2023”, “weight”:23}, map[string]interface {}{“name”:“Expenses”, “pageRef”:“expenses”, “url”:“/expenses”, “weight”:20}, map[string]interface {}{“name”:“Expenses2022”, “pageRef”:“expenses2022”, “parent”:“expenses”, “url”:“/expenses2022”, “weight”:22}, map[string]interface {}{“name”:“Expenses2023”, “pageRef”:“expenses2023”, “parent”:“expenses”, “url”:“/expenses2023”, “weight”:23}, map[string]interface {}{“name”:“Minutes”, “pageRef”:“minutes”, “url”:“/minutes”, “weight”:30}, map[string]interface {}{“name”:“News”, “pageRef”:“news”, “url”:“/news”, “weight”:40}, map[string]interface {}{“name”:“Webmaster News”, “pageRef”:“webmaster news”, “parent”:“news”, “url”:“/webmaster”, “weight”:44}, map[string]interface {}{“name”:“President News”, “pageRer”:“president news”, “parent”:“news”, “url”:“/president”, “weight”:42}, map[string]interface {}{“name”:“Blog”, “pageRef”:“blog”, “url”:“/blog”, “weight”:50}, map[string]interface {}{“name”:“President Blog”, “pageRef”:“president blog”, “parent”:“blog”, “url”:“/president”, “weight”:52}, map[string]interface {}{“name”:“Webmaster Blog”, “pageRef”:“webmaster blog”, “parent”:“blog”, “url”:“/webmaster”, “weight”:54}}} of type maps.Params to interface{}" after all of the hugo help commands.
If I remove the indention i get the following error:
" Error: command error: failed to create config from result: failed to decode “menus”: unable to cast of type to interface{}" again after the hugo help screen.
If I remove the menus.yaml file after copying it the config.yaml I get the following error:
“Error: command error: failed to load config: failed to unmarshal config for path “/media/gerald/Projects/EPGHOA/epghoa.org/config/_default/config.yaml”: “_stream.yaml:59:1”: failed to unmarshal YAML: yaml: line 59: did not find expected key”
The following is my Menus.yaml file.
menu:
main:
- name: HOME
url: /
weight: 1
pageRef: home
- name: Dues
url: /dues
weight: 10
pageRef: dues
- name: Dues2022
url: /dues2022
weight: 22
pageRef: dues2022
parent: dues
- name: Dues2023
url: /dues2023
pageRef: dues2023
weight: 23
parent: dues
- name: Expenses
url: /expenses
weight: 20
pageRef: expenses
- name: Expenses2022
url: /expenses2022
weight: 22
pageRef: expenses2022
parent: expenses
- name: Expenses2023
url: /expenses2023
pageRef: expenses2023
weight: 23
parent: expenses
- name: Minutes
url: /minutes
pageRef: minutes
weight: 30
- name: News
url: /news
pageRef: news
weight: 40
- name: Webmaster News
url: /webmaster
pageRef: webmaster news
weight: 44
parent: news
- name: President News
url: /president
pageRer: president news
weight: 42
parent: news
- name: Blog
url: /blog
pageRef: blog
weight: 50
- name: President Blog
url: /president
pageRef: president blog
weight: 52
parent: blog
- name: Webmaster Blog
url: /webmaster
pageRef: webmaster blog
weight: 54
parent: blog
When I posted this it removed all of the indention’s
I am using Hugo 0.115.4 and my theme is “Docsy”
Any ideas of what I am doing wrong?
Thanks.