Name property in front matter for menu

I have menu defined in front matter and it works but picks the linktitle attribute not the name. Is there an issue or I am doing something wrong? What I see in menu that shows up is ‘Website title 2’ not Home.

Front matter example:

---
draft: false
menus: main
name: Home
title: Website title
linktitle: Website title 2
params: 
 author: xxxx
---

Partial:

{{- range site.Menus.main }}
  <a href="{{ .URL }}">
    {{ .Name }}
  </a>
{{- end }}

Your yaml is plain. The attributes should be nested to the menu enty.

Hav a look at incl. The example

Define menu in frontmatter

2 Likes

Thanks very much yes that works.

menus: 
 main:
  name: Home

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.