aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2020-12-04 11:53:14 +0200
committerXhmikosR <[email protected]>2021-01-08 09:49:18 +0200
commitd9adaae5b0fe41e237f20f2dc1232a1025af9d1b (patch)
treeaf88ed88d4e096a381b917c42367d706213b4e92
parent480e7e61b602bcf6475b39d1180d8ab0c57bc878 (diff)
downloadbootstrap-d9adaae5b0fe41e237f20f2dc1232a1025af9d1b.tar.xz
bootstrap-d9adaae5b0fe41e237f20f2dc1232a1025af9d1b.zip
Move migration sidebar entry to sidebar.yml
-rw-r--r--site/data/sidebar.yml6
-rw-r--r--site/layouts/partials/docs-sidebar.html50
2 files changed, 30 insertions, 26 deletions
diff --git a/site/data/sidebar.yml b/site/data/sidebar.yml
index 80256e9f0..a4d4ccbbd 100644
--- a/site/data/sidebar.yml
+++ b/site/data/sidebar.yml
@@ -1,3 +1,6 @@
+# This file holds all sidebar menu's entries.
+# The logic for the sidebar generation is in "site/layouts/partials/docs-sidebar.html".
+
- title: Getting started
pages:
- title: Introduction
@@ -26,7 +29,6 @@
- title: Breakpoints
- title: Containers
- title: Grid
- # - title: Rows
- title: Columns
- title: Gutters
- title: Utilities
@@ -117,3 +119,5 @@
- title: Brand
- title: License
- title: Translations
+
+- title: Migration
diff --git a/site/layouts/partials/docs-sidebar.html b/site/layouts/partials/docs-sidebar.html
index 94acb4786..ba974f4cd 100644
--- a/site/layouts/partials/docs-sidebar.html
+++ b/site/layouts/partials/docs-sidebar.html
@@ -13,33 +13,33 @@
{{- end -}}
{{- $group_slug := $group.title | urlize -}}
- {{- $is_active_group := eq $.Page.Params.group $group_slug }}
+ {{- $is_active_group := eq $.Page.Params.group $group_slug -}}
- <li class="mb-1{{ if $is_active_group }} active{{ end }}">
- <button class="btn d-inline-flex align-items-center rounded{{ if not $is_active_group }} collapsed{{ end }}" data-bs-toggle="collapse" data-bs-target="#{{ $group_slug }}-collapse" aria-expanded="{{ $is_active_group }}"{{ if $is_active_group }} aria-current="true"{{ end }}>
- {{ $group.title }}
- </button>
+ {{- if $group.pages }}
+ <li class="mb-1{{ if $is_active_group }} active{{ end }}">
+ <button class="btn d-inline-flex align-items-center rounded{{ if not $is_active_group }} collapsed{{ end }}" data-bs-toggle="collapse" data-bs-target="#{{ $group_slug }}-collapse" aria-expanded="{{ $is_active_group }}"{{ if $is_active_group }} aria-current="true"{{ end }}>
+ {{ $group.title }}
+ </button>
- {{- if $group.pages }}
- <div class="collapse{{ if $is_active_group }} show{{ end }}" id="{{ $group_slug }}-collapse">
- <ul class="list-unstyled fw-normal pb-1 small">
- {{- range $doc := $group.pages -}}
- {{- $doc_slug := $doc.title | urlize -}}
- {{- $is_active := and $is_active_group (eq $page_slug $doc_slug) -}}
- {{- $href := printf "/docs/%s/%s/%s/" $.Site.Params.docs_version $group_slug $doc_slug }}
- <li><a href="{{ $href }}" class="d-inline-flex align-items-center rounded{{ if $is_active }} active{{ end }}"{{ if $is_active }} aria-current="page"{{ end }}>{{ $doc.title }}</a></li>
- {{- end }}
- </ul>
- </div>
- {{- end }}
- </li>
+ <div class="collapse{{ if $is_active_group }} show{{ end }}" id="{{ $group_slug }}-collapse">
+ <ul class="list-unstyled fw-normal pb-1 small">
+ {{- range $doc := $group.pages -}}
+ {{- $doc_slug := $doc.title | urlize -}}
+ {{- $is_active := and $is_active_group (eq $page_slug $doc_slug) -}}
+ {{- $href := printf "/docs/%s/%s/%s/" $.Site.Params.docs_version $group_slug $doc_slug }}
+ <li><a href="{{ $href }}" class="d-inline-flex align-items-center rounded{{ if $is_active }} active{{ end }}"{{ if $is_active }} aria-current="page"{{ end }}>{{ $doc.title }}</a></li>
+ {{- end }}
+ </ul>
+ </div>
+ </li>
+ {{- else }}
+ <li class="my-3 mx-4 border-top"></li>
+ <li{{ if $is_active_group }} class="active"{{ end }}>
+ <a href="/docs/{{ $.Site.Params.docs_version }}/{{ $group_slug }}/" class="d-inline-flex align-items-center rounded">
+ {{ $group.title }}
+ </a>
+ </li>
+ {{- end }}
{{- end }}
-
- <li class="my-3 mx-4 border-top"></li>
- <li{{ if eq $page_slug "migration" }} class="active"{{ end }}>
- <a href="/docs/{{ $.Site.Params.docs_version }}/migration/" class="d-inline-flex align-items-center rounded">
- Migration
- </a>
- </li>
</ul>
</nav>