hotfix: fix product and version dropdown order

pull/4883/head
Scott Anderson 2023-04-20 11:07:03 -06:00
parent f9df59881f
commit 1f06b034e5
4 changed files with 7 additions and 7 deletions

View File

@ -99,7 +99,7 @@
margin: 0;
list-style: none;
display: flex;
flex-direction: column-reverse;
flex-direction: column;
&.products{
li {
@ -113,7 +113,7 @@
opacity: .65;
mix-blend-mode: multiply;
}
&:last-child:before {
&:first-child:before {
content: "Products";
margin: .3rem .75rem .15rem;
}

View File

@ -1,5 +1,5 @@
{{ $influxdbVersionV2 := (index (first 1 (findRE `v2\.[0-9]{1,2}` (delimit .Site.Data.products.influxdb.versions " "))) 0) }}
{{ $influxdbVersionV1 := (index (last 1 (findRE `v1\.[0-9]{1,2}` (delimit .Site.Data.products.influxdb.versions " "))) 0) }}
{{ $influxdbVersionV1 := (index (first 1 (findRE `v1\.[0-9]{1,2}` (delimit .Site.Data.products.influxdb.versions " "))) 0) }}
{{ $enterpriseVersion := .Site.Data.products.enterprise_influxdb.latest }}
{{ $telegrafVersion := .Site.Data.products.telegraf.latest }}
{{ $chronografVersion := .Site.Data.products.chronograf.latest }}

View File

@ -18,7 +18,7 @@
<p class="selected">{{ if $productData.altname }}{{ $productData.altname }}{{ else }}{{ $productData.name }}{{ end }}</p>
{{ end }}
<ul class="item-list products">
{{ range sort .Site.Data.products "list_order" "desc" }}
{{ range sort .Site.Data.products "list_order" "asc" }}
{{ $isCurrentProduct := and (eq .namespace $product) (in .versions $currentVersion) }}
{{ $scratch.Set "link" (print "/" .namespace "/" .latest "/") }}
{{ if $isCurrentProduct }}

View File

@ -8,9 +8,6 @@
<div class="dropdown">
<p class="selected">{{ cond (in $currentVersion "v") $currentVersion (title $currentVersion) }}</p>
<ul class="item-list versions">
{{ if ne $product "flux" }}
<li><a href="https://archive.docs.influxdata.com/{{ $product }}/" class="legacy" target="_blank">older</a></li>
{{ end }}
{{ range (index .Site.Data.products $product).versions }}
{{ $scratch.Set "link" (print "/" $product "/" . "/") }}
{{ $altVersionPage := $.GetPage ((replaceRE $currentVersion . $.Page.RelPermalink) | replaceRE `\/$` "") }}
@ -24,6 +21,9 @@
<a href="{{ $link }}" {{ if eq . $currentVersion }}class="active"{{ end }}>{{ cond (in . "v") . (title .) }}</a>
</li>
{{ end }}
{{ if ne $product "flux" }}
<li><a href="https://archive.docs.influxdata.com/{{ $product }}/" class="legacy" target="_blank">older</a></li>
{{ end }}
</ul>
</div>
{{ end }}