mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-31 17:11:48 +02:00
Improve docs sidenav active link highlighting
Capture the slug once before applying it and add a slash to it to so we get a unique string to match against instead of a fuzzy partial 'contains'. Helps avoid 'grid' highlighting 'flexbox-grid', for example.
This commit is contained in:
@@ -25,6 +25,7 @@
|
|||||||
<ul class="nav bd-sidenav">
|
<ul class="nav bd-sidenav">
|
||||||
{% for doc in group.pages %}
|
{% for doc in group.pages %}
|
||||||
{% assign slug = doc.title | downcase | replace: ' ', '-' | replace:'-&-','-' %}
|
{% assign slug = doc.title | downcase | replace: ' ', '-' | replace:'-&-','-' %}
|
||||||
|
{% capture slug %}/{{ slug }}{% endcapture %}
|
||||||
{% assign active = nil %}
|
{% assign active = nil %}
|
||||||
|
|
||||||
{% if page.url contains slug %}
|
{% if page.url contains slug %}
|
||||||
|
Reference in New Issue
Block a user