Files with identical titles not appearing in Docs menu #117
Replies: 4 comments 4 replies
-
Try looking at weights in markdown frontmatter, write back if no solution |
Beta Was this translation helpful? Give feedback.
-
If I give 2016 The 2017 parent title does not appear in the menu. Is there something I'm missing (somewhere else I should be looking)? EDIT: If I remove 2016 |
Beta Was this translation helpful? Give feedback.
-
Yes there is. See section Menu Entry Variables from the Hugo docs:
So, add unique identifiers like so e.g.: ---
title: "Information"
description: ""
lead: ""
date: 2021-02-07T15:00:02+01:00
lastmod: 2021-02-07T15:00:02+01:00
draft: false
images: []
menu:
docs:
parent: "2017"
identifier: "info-2017"
weight: 200
toc: true
--- ---
title: "Information"
description: ""
lead: ""
date: 2021-02-07T15:00:07+01:00
lastmod: 2021-02-07T15:00:07+01:00
draft: false
images: []
menu:
docs:
parent: "2016"
identifier: "info-2016"
weight: 210
toc: true
--- And, make sure to add to [[docs]]
name = "2017"
weight = 15
identifier = "2017"
url = "/docs/archive/2017/"
[[docs]]
name = "2016"
weight = 20
identifier = "2016"
url = "/docs/archive/2016/" Like @epogrebnyak indicated, you can use The result: |
Beta Was this translation helpful? Give feedback.
-
UPDATE QUESTION: Menu is working great. However, when I click on one of the pages, all the other similarly named pages get highlighted. Example menu: 2018 When I click on either "Information" link in the doks menu, BOTH get highlighted purple. Anyway we can limit the color to the selected menu option? |
Beta Was this translation helpful? Give feedback.
-
If I have
where the nested
.md
files have a title that reflects their filename (i.e.title: "Information"
forinformation.md
). Each.md
file has its own unique parent defined (e.g.parent: "2017"
andparent: "2016"
).Unfortunately, the docs menu renders as
2017
2016
Information
I want it to show
2017
Information
2016
Information
If I give the
.md
files unique titles such astitle: "2016 Information"
forarchive/2016/information.md
andtitle: "2017 Information"
forarchive/2017/information.md
the docs menu shows
2016
2016 Information
2017
2017 Information
Is there a way to have files with identical filenames that are recognized by the subfolder they are in and shown under their respective
parent
in the docs menu? Can the menu be sorted in reverse chronological order?Beta Was this translation helpful? Give feedback.
All reactions