{{ $productPathData := findRE "[^/]+.*?" .RelPermalink }} {{ $product := index $productPathData 0 }} {{ $version := index $productPathData 1 | default "0"}} {{ $productKey := cond (eq $product "influxdb3") (print "influxdb3_" (replaceRE "-" "_" $version)) $product }} {{ $successorInfo := dict "exists" false }} {{ $productName := $product | humanize }} {{ $stableVersion := "" }} {{ $stableVersionURL := "" }} {{ $stableDefaultURL := "" }} {{ if isset .Site.Data.products $productKey }} {{ $productName = cond (isset (index .Site.Data.products $productKey) "altname") (index .Site.Data.products $productKey).altname (index .Site.Data.products $productKey).name }} {{ end }} {{ if and (isset .Site.Data.products $productKey) (isset (index .Site.Data.products $productKey) "succeeded_by") }} {{ $successorKey := (index .Site.Data.products $productKey).succeeded_by }} {{ if and $successorKey (isset .Site.Data.products $successorKey) }} {{ $successorInfo = dict "exists" true "key" $successorKey "name" (cond (isset (index .Site.Data.products $successorKey) "altname") (index .Site.Data.products $successorKey).altname (index .Site.Data.products $successorKey).name) "version" (replaceRE `\.[0-9x]+$` "" (index .Site.Data.products $successorKey).latest) "namespace" (index .Site.Data.products $successorKey).namespace }} {{ $stableVersion = $successorInfo.version }} {{ $stableVersionURL = print "/" $successorInfo.namespace "/" $stableVersion "/" }} {{ $stableDefaultURL = $stableVersionURL }} {{ end }} {{ else if isset .Site.Data.products $product }} {{ $stableVersion = (replaceRE `\.[0-9x]+$` "" (index .Site.Data.products $product).latest) }} {{ $stableVersionURL = replaceRE `v[1-3]` $stableVersion .RelPermalink }} {{ $stableDefaultURL = print "/" $product "/" $stableVersion "/" }} {{ end }} {{ $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 $successorInfo.exists }}
This page documents an earlier version of {{ $productName }}. {{ $successorInfo.name }} is the latest stable version.
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 {{ $productName }} {{ $stableVersion }} documentation: {{ $stableEquivalentPage.Title | .RenderString }}. {{ else }} See the {{ $productName }} {{ $stableVersion }} documentation. {{ end }}