{{ $productPathData := findRE "[^/]+.*?" .RelPermalink }} {{ $product := index $productPathData 0 }} {{ $version := index $productPathData 1 | default "0"}} {{ $productKey := cond (eq $product "influxdb3") (print "influxdb3_" (replaceRE "-" "_" $version)) $product }} {{ $productName := cond (isset (index .Site.Data.products $productKey) "altname") (index .Site.Data.products $productKey).altname (index .Site.Data.products $productKey).name }} {{ $stableVersion := (replaceRE `\.[0-9x]+$` "" (index .Site.Data.products $product).latest) }} {{ $stableVersionURL := replaceRE `v[1-3]` $stableVersion .RelPermalink }} {{ $stableDefaultURL := print "/" $product "/" $stableVersion "/" }} {{ $stableEquivalentURL := index .Page.Params.alt_links $stableVersion | default "does-not-exist" }} {{ $stableEquivalentPage := .GetPage (replaceRE `\/$` "" $stableEquivalentURL) }} {{ $stablePageExists := gt (len $stableEquivalentPage.Title) 0 }} {{ $productWhiteList := slice "telegraf" "influxdb" "chronograf" "kapacitor" "flux" }} {{ $isMultiVersion := in (print "/" $version) "/v" }} {{ if and (in $productWhiteList $product) $isMultiVersion }} {{ if lt (int (replaceRE `[a-z]` "" $version)) (int (replaceRE `[a-z]` "" $stableVersion)) }}
This page documents an earlier version of {{ $productName }}. {{ $productName }} {{ $stableVersion }} is the latest stable version. {{ if gt (len (.GetPage ((replaceRE `v[1-3]` $stableVersion .RelPermalink) | replaceRE `\/$` "")).Title) 0 }} View this page in the {{ $stableVersion }} documentation. {{ else if $stablePageExists }} See the equivalent InfluxDB {{ $stableVersion }} documentation: {{ $stableEquivalentPage.Title | .RenderString }}. {{ else }} See the InfluxDB {{ $stableVersion }} documentation. {{ end }}
{{ if $stablePageExists }} See the equivalent InfluxDB {{ $stableVersion }} documentation: {{ $stableEquivalentPage.Title | .RenderString }}. {{ else }} See the equivalent InfluxDB {{ $stableVersion }} documentation. {{ end }}