Header items dissapear if they do not start with capital letter in site.yaml
Header items dissapear if they do not start with capital letter in site.yaml
- From starter
simple-blogedit site.yaml, and alternatively set navigation item, "Emma Bennet" to "emma" or "Emma" and observe that the header item dissapears when it's not capitilised.
header:
navigation:
- emma Bennet: /
- Contact: /contact/
footer:
copyright:
- © Emma Bennet: /
Environment
- OS: OSX
- Nuekit Version: ✓ Nue 1.0.0-beta.2 • Bun 1.1.27
Minimal Reproduction
Logs & Additional Context
Thanks for the bug report.
I'd suspect this line, but I haven't read through this code, so feel free to propose a fix yourself.
https://github.com/nuejs/nue/blob/c67208e8774f5e1b107dc5bd8f945f533c3afb1b/packages/nuekit/src/layout/navi.js#L16
@nobkd that looks suspiciously like a convention over configuration where lowercase is reserved for Hidden items, perhaps javascript usage? before removing that line I'd chase down the original commit / author / blame etc and-or see if anyone can remember why it's like that? ;D
It's ok for now; however personally I'm a huge fan of lowercase text wherever possible and can expect that to come back and bite me later; regardless of whether we always use capital letters in link text or not, having that forced on us looks like a bad bug waiting to happen.
@tipiirai did you do this, to have keys that are lowercase to stay keys and Uppercase items get transformed?
{faq: '/faq/'} -> {faq: '/faq'}
{Faq: '/faq/'} -> {text: 'Faq', url: '/faq/'}
(It's always possible to use text-transform: lowercase css, to have lowercase items in the nav...)