Navigation title "Navigation" in .navigation.md is silently dropped
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- nuxt, typescript
- Domain
- web-dev
Research direction
Start in src/runtime/internal/navigation.ts at the linked title-handling logic, then use the StackBlitz reproduction to confirm the behavior for a frontmatter title of "Navigation". The change is done when an explicitly configured title remains visible while generated navigation titles and their fallbacks still behave as expected.
Written by the indexing model from the issue text.
Description
Environment
ERROR Cannot read properties of null (reading 'name')
Version
3.16.0
Reproduction
https://stackblitz.com/edit/github-xzzfd3yf
Description
I am writing the documentation for a gliding software with Nuxt Docus. One section covers the in-app navigation, so the menu item really needs to be called "Navigation". If I set exactly this title in the .navigation.md of that section, the menu item shows up without any label. Any other title, like "Navigation & Menu", works fine.
The cause is here: https://github.com/nuxt/content/blob/656a5ce1a8cb6af0b37dd577bf4e1522e03e3c11/src/runtime/internal/navigation.ts#L24-L25
A title that equals "navigation" (case insensitive) is replaced with an empty string, presumably to discard the auto generated title derived from the file name. This makes it impossible to explicitly use "Navigation" as a section title, and there is no warning that the title is being dropped.
Expected behavior
It should be possible to explicitly name a section "Navigation". Possible fixes:
- Only discard the title when it was not set explicitly in the frontmatter, instead of comparing the string value.
- Or set the title to
undefinedinstead of an empty string, so the title fromindex.mdor the generated directory title is used as a fallback.
- Dominant language
- TypeScript
- Stars
- 3.7k
- Forks
- 746
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nuxt/content
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
defineGitSource Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
-
Comark support Openenhancement
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100