Skip to content

Commit

Permalink
docs: drop Scratch usage (#36337)
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR authored May 13, 2022
1 parent 6c10d60 commit ce650e7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions site/layouts/partials/docs-versions.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

{{- $versions_link := "" -}}
{{- if and (eq .Layout "docs") (eq $page_version .Site.Params.docs_version) -}}
{{- .Scratch.Set "versions_link" (printf "%s/%s/" $group_slug $page_slug) -}}
{{- $versions_link = printf "%s/%s/" $group_slug $page_slug -}}
{{- else if (eq .Layout "single") }}
{{- .Scratch.Set "versions_link" (printf "%s/" $page_slug) -}}
{{- $versions_link = printf "%s/" $page_slug -}}
{{- end }}

<li class="nav-item dropdown">
Expand All @@ -17,22 +17,22 @@
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="bd-versions">
<li><h6 class="dropdown-header">v5 releases</h6></li>
<li>
<a class="dropdown-item current" aria-current="true" href="/docs/{{ .Site.Params.docs_version }}/{{ .Scratch.Get "versions_link" }}">
<a class="dropdown-item current" aria-current="true" href="/docs/{{ .Site.Params.docs_version }}/{{ $versions_link }}">
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/{{ .Scratch.Get "versions_link" }}">v5.1.3</a>
<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/{{ .Scratch.Get "versions_link" }}">v5.0.2</a>
<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>
Expand Down

0 comments on commit ce650e7

Please sign in to comment.