minimal-mistakes
minimal-mistakes copied to clipboard
nav_list empty links
This is an enhancement or feature.
Summary
An empty-string child url in nav_list should produce an unlinked title.
Context
By default, a nav_list child entry without a link defaults to a link to the current page.
There are times when what you really want is NO link. See the sidebar here for an example. To maintain backwards compatibility, this change enables this behavior only when the url property is explicitly set to an empty string, like this:
entity-manager:
- title: Packages
children:
- title: <strong><code>entity-manager</code></strong>
url: '' # 👈 THIS!
- title: <i class="fa-brands fa-github fa-lg"></i> GitHub
url: https://github.com/karmaniverous/entity-manager
- title: <i class="fa-solid fa-heart fa-lg"></i> NPM
url: https://www.npmjs.com/package/@karmaniverous/entity-manager
- title: <i class="fa-solid fa-book fa-lg"></i> API
url: https://docs.karmanivero.us/entity-manager/
- title: <i class="fa-solid fa-comment fa-lg"></i> Help
url: https://github.com/karmaniverous/entity-manager/discussions
What about replacing "empty URL" with either null or false, so that {% if child.url == "" %} can be written as {% if child.url %}? I also think these are more explicit than an empty string.
I was concerned about backwards compatibility. I think if you make that change a bunch of people my find their existing links no longer working as expected.