mirror of
https://github.com/twbs/bootstrap.git
synced 2025-06-02 00:01:57 -04:00
Documentation navigation fixes. (#21288)
* Make /utilities/ redirect to /utilities/borders/. * Rewrite sidebar active link logic to ensure superstrings are not selected.
This commit is contained in:
parent
5a19d48705
commit
a3567a119d
@ -4,36 +4,33 @@
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
<nav class="bd-links" id="docsNavbarContent">
|
<nav class="bd-links" id="docsNavbarContent">
|
||||||
|
{% assign page_slug = page.url | split: '/' | last %}
|
||||||
{% for group in site.data.nav %}
|
{% for group in site.data.nav %}
|
||||||
{% assign link = group.pages | first %}
|
{% 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 %}
|
{% assign active = nil %}
|
||||||
|
|
||||||
{% if page.url contains slug %}
|
{% if page.group == group_slug %}
|
||||||
{% assign active = 'active' %}
|
{% assign active = 'active' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="bd-toc-item {{ active }}">
|
<div class="bd-toc-item {{ active }}">
|
||||||
{% if slug == "examples" %}
|
<a class="bd-toc-link" href="{{ site.baseurl }}/{{ group_slug }}/{{ link_slug }}{% if link_slug %}/{% endif %}">
|
||||||
<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 %}
|
|
||||||
{{ group.title }}
|
{{ group.title }}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<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 doc_slug = doc.title | slugify %}
|
||||||
{% capture slug %}/{{ slug }}{% endcapture %}
|
|
||||||
{% assign active = nil %}
|
{% assign active = nil %}
|
||||||
|
|
||||||
{% if page.url contains slug %}
|
{% if page.group == group_slug and page_slug == doc_slug %}
|
||||||
{% assign active = 'active bd-sidenav-active' %}
|
{% assign active = 'active bd-sidenav-active' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<li class="{{ active }}">
|
<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 }}
|
{{ doc.title }}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
layout: docs
|
layout: docs
|
||||||
title: Borders
|
title: Borders
|
||||||
group: utilities
|
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.
|
Use border utilities to quickly style the `border` and `border-radius` of an element. Great for images, buttons, or any other element.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user