diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-01-24 12:33:51 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-01-24 12:33:51 +0000 |
commit | 3ea39841c8049525e31e9f4d6300f0c60cdb42de (patch) | |
tree | 855de60a8872eafb5911acd303aedcdbfe713a73 /site/layouts/partials/docs-versions.html | |
parent | Inital commit. (diff) | |
download | bootstrap-html-3ea39841c8049525e31e9f4d6300f0c60cdb42de.tar.xz bootstrap-html-3ea39841c8049525e31e9f4d6300f0c60cdb42de.zip |
Adding upstream version 5.2.3+dfsg.upstream/5.2.3+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'site/layouts/partials/docs-versions.html')
-rw-r--r-- | site/layouts/partials/docs-versions.html | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/site/layouts/partials/docs-versions.html b/site/layouts/partials/docs-versions.html new file mode 100644 index 0000000..9b662e6 --- /dev/null +++ b/site/layouts/partials/docs-versions.html @@ -0,0 +1,46 @@ +{{- $url := split .Permalink "/" -}} +{{- $page_version := index $url (sub (len $url) 4) -}} +{{- $group_slug := index $url (sub (len $url) 3) -}} +{{- $page_slug := index $url (sub (len $url) 2) -}} + +{{- $versions_link := "" -}} +{{- if and (eq .Layout "docs") (eq $page_version .Site.Params.docs_version) -}} + {{- $versions_link = printf "%s/%s/" $group_slug $page_slug -}} +{{- else if (eq .Layout "single") }} + {{- $versions_link = printf "%s/" $page_slug -}} +{{- end }} + +<li class="nav-item dropdown"> + <button type="button" class="btn btn-link nav-link py-2 px-0 px-lg-2 dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false" data-bs-display="static"> + <span class="d-lg-none" aria-hidden="true">Bootstrap</span><span class="visually-hidden">Bootstrap </span> v{{ .Site.Params.docs_version }} <span class="visually-hidden">(switch to other versions)</span> + </button> + <ul class="dropdown-menu dropdown-menu-end"> + <li><h6 class="dropdown-header">v5 releases</h6></li> + <li> + <a class="dropdown-item current" aria-current="true" href="{{ if .IsHome }}/{{ else }}/docs/{{ .Site.Params.docs_version }}/{{ $versions_link }}{{ end }}"> + Latest ({{ .Site.Params.docs_version }}.x) + </a> + </li> + <li> + {{- if (eq .Page.Params.added "5.2") }} + <div class="dropdown-item disabled">v5.1.3</div> + {{- else }} + <a class="dropdown-item" href="https://getbootstrap.com/docs/5.1/{{ $versions_link }}">v5.1.3</a> + {{- end }} + </li> + <li> + {{- if or (eq .Page.Params.added "5.1") (eq .Page.Params.added "5.2") }} + <div class="dropdown-item disabled">v5.0.2</div> + {{- else }} + <a class="dropdown-item" href="https://getbootstrap.com/docs/5.0/{{ $versions_link }}">v5.0.2</a> + {{- end }} + </li> + <li><hr class="dropdown-divider"></li> + <li><h6 class="dropdown-header">Previous releases</h6></li> + <li><a class="dropdown-item" href="https://getbootstrap.com/docs/4.6/">v4.6.x</a></li> + <li><a class="dropdown-item" href="https://getbootstrap.com/docs/3.4/">v3.4.1</a></li> + <li><a class="dropdown-item" href="https://getbootstrap.com/2.3.2/">v2.3.2</a></li> + <li><hr class="dropdown-divider"></li> + <li><a class="dropdown-item" href="/docs/versions/">All versions</a></li> + </ul> +</li> |