aboutsummaryrefslogtreecommitdiff
path: root/docs/_includes/nav-docs.html
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2017-05-26 22:28:09 -0700
committerMark Otto <[email protected]>2017-05-26 22:28:09 -0700
commit6c3f833076a9fa68601741e3e21bd07ad79b7d8a (patch)
treefe016946d77f9ffff15bbe9cdc593fd098b5bcc7 /docs/_includes/nav-docs.html
parentc581564a780974c6430ac5897740006f623f2277 (diff)
parent5d7db507396275fcda96935aff47b09e1d79ddc1 (diff)
downloadbootstrap-6c3f833076a9fa68601741e3e21bd07ad79b7d8a.tar.xz
bootstrap-6c3f833076a9fa68601741e3e21bd07ad79b7d8a.zip
Merge branch 'v4-docs-streamlined' of https://github.com/twbs/bootstrap into v4-docs-streamlined
Diffstat (limited to 'docs/_includes/nav-docs.html')
-rw-r--r--docs/_includes/nav-docs.html19
1 files changed, 8 insertions, 11 deletions
diff --git a/docs/_includes/nav-docs.html b/docs/_includes/nav-docs.html
index 26507f161..ab9c43c81 100644
--- a/docs/_includes/nav-docs.html
+++ b/docs/_includes/nav-docs.html
@@ -1,34 +1,31 @@
<nav class="bd-links" id="docsNavbarContent">
+ {% assign page_slug = page.url | split: '/' | last %}
{% for group in site.data.nav %}
{% assign link = group.pages | first %}
- {% assign slug = group.title | downcase | replace: ' ', '-' || page.title | downcase | replace: ' ', '-' | append: '/' %}
+ {% assign link_slug = link.title | slugify %}
+ {% assign group_slug = group.title | slugify %}
{% assign active = nil %}
- {% if page.url contains slug %}
+ {% if page.group == group_slug %}
{% assign active = 'active' %}
{% endif %}
<div class="bd-toc-item {{ active }}">
- {% if slug == "examples" %}
- <a class="bd-toc-link" href="{{ site.baseurl }}/{{ group.title | downcase | replace: ' ', '-' }}/">
- {% else %}
- <a class="bd-toc-link" href="{{ site.baseurl }}/{{ group.title | downcase | replace: ' ', '-' }}/{{ link.title | downcase | replace: ' ', '-' || page.title | downcase | replace: ' ', '-' }}">
- {% endif %}
+ <a class="bd-toc-link" href="{{ site.baseurl }}/{{ group_slug }}/{{ link_slug }}{% if link_slug %}/{% endif %}">
{{ group.title }}
</a>
<ul class="nav bd-sidenav">
{% for doc in group.pages %}
- {% assign slug = doc.title | downcase | replace: ' ', '-' | replace:'-&-','-' %}
- {% capture slug %}/{{ slug }}{% endcapture %}
+ {% assign doc_slug = doc.title | slugify %}
{% assign active = nil %}
- {% if page.url contains slug %}
+ {% if page.group == group_slug and page_slug == doc_slug %}
{% assign active = 'active bd-sidenav-active' %}
{% endif %}
<li class="{{ active }}">
- <a href="{{ site.baseurl }}/{{ group.title | downcase | replace: ' ', '-' }}/{{ doc.title | downcase | replace: ' ', '-' | replace:'-&-','-' }}/">
+ <a href="{{ site.baseurl }}/{{ group_slug }}/{{ doc_slug }}/">
{{ doc.title }}
</a>