Commit 42c52a27 authored by Mark Otto's avatar Mark Otto
Browse files

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.
parent 263e06a0
Showing with 1 addition and 0 deletions
+1 -0
......@@ -25,6 +25,7 @@
<ul class="nav bd-sidenav">
{% for doc in group.pages %}
{% assign slug = doc.title | downcase | replace: ' ', '-' | replace:'-&-','-' %}
{% capture slug %}/{{ slug }}{% endcapture %}
{% assign active = nil %}
{% if page.url contains slug %}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment