Hi, I’m trying PaperMod with the newest verion of Hugo. I added 5 unique menu items
to my site’s hugo.yml and attempted to create an archives.md, which gave me:
Error: failed to create config from result: failed to decode "menus": unable to cast maps.Params{"identifier":"links", "name":"Links", "url":"/links/", "weight":50} of type maps.Params to []interface{}
This was the 5th menu item. What went wrong?
It would be helpful if you could share some more information. For example, the menu entries as they appear in your site configuration, the code that renders the menu, etc.
Okay, here’s hugo.yml’s menu. everything was okay, but the end of this:
menu:
main:
identifier: topics
name: Topics
url: /topics/
weight: 10
identifier: tags
name: Tags
url: /tags/
weight: 20
identifier: archives
name: Archives
url: /archives/
weight: 30
identifier: about
name: About
url: /about/
weight: 40
identifier: links
name: Links
url: /links/
weight: 50
#Now for the code to create archives.md:
C:\Users\User\Documents\User\Websites\main website\mysite>hugo new archives.md
That’s when I got the error.
Please compare your yaml to the examples in the documentation.
Are you telling me that there’s a weight limit? That’s the only way I can process
your answer. That comment and hugo code is not in the actual yml.
Update: Forgot the "- " indent for the start of each item and the the indents of each detail after it. Compiled it, and it worked like a charm!
Sorry for the confusion.