aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBardi Harborow <[email protected]>2016-12-05 11:44:37 +1100
committerMark Otto <[email protected]>2016-12-04 16:44:37 -0800
commita3567a119df3434d879f766e18ba452b01871d37 (patch)
treef2d76bab099e137eb54fe0fecde5cde382abfc3e /docs
parent5a19d4870537ca85ba38beeb7eabe80858417b72 (diff)
downloadbootstrap-a3567a119df3434d879f766e18ba452b01871d37.tar.xz
bootstrap-a3567a119df3434d879f766e18ba452b01871d37.zip
Documentation navigation fixes. (#21288)
* Make /utilities/ redirect to /utilities/borders/. * Rewrite sidebar active link logic to ensure superstrings are not selected.
Diffstat (limited to 'docs')
-rw-r--r--docs/_includes/nav-docs.html19
-rw-r--r--docs/utilities/borders.md1
2 files changed, 9 insertions, 11 deletions
diff --git a/docs/_includes/nav-docs.html b/docs/_includes/nav-docs.html
index 005f96435..2b44c8acc 100644
--- a/docs/_includes/nav-docs.html
+++ b/docs/_includes/nav-docs.html
@@ -4,36 +4,33 @@
</form>
<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: ' ', '-' %}
+ {% 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: ' ', '-' }}{% if link.title || page.title %}/{% endif %}">
- {% 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>
diff --git a/docs/utilities/borders.md b/docs/utilities/borders.md
index 1eb716c1f..1f092c36a 100644
--- a/docs/utilities/borders.md
+++ b/docs/utilities/borders.md
@@ -2,6 +2,7 @@
layout: docs
title: Borders
group: utilities
+redirect_from: "/utilities/"
---
Use border utilities to quickly style the `border` and `border-radius` of an element. Great for images, buttons, or any other element.