{{ $scratch := newScratch }} {{ $productPathData := findRE "[^/]+.*?" .RelPermalink }} {{ $product := index $productPathData 0 }} {{ $version := index $productPathData 1 }} {{ $pageRoot := print $product "/" $version }} {{ $useRootProductLink := or (eq $product nil) (in (slice "resources" "platform") $product) }} {{ $altLinks := .Page.Params.alt_links | default dict }} {{ $influxdbOSSv1 := dict "influxdb/v1" (slice "InfluxDB OSS v1" "v1") }} {{ $influxdbOSSv2 := dict "influxdb/v2" (slice "InfluxDB OSS v2" "v2") }} {{ $influxdbCloud := dict "influxdb/cloud" (slice $.Site.Data.products.influxdb_cloud.name "cloud") }} {{ $influxdb3Core := dict "influxdb3/core" (slice $.Site.Data.products.influxdb3_core.name "core") }} {{ $influxdb3Enterprise := dict "influxdb3/enterprise" (slice $.Site.Data.products.influxdb3_enterprise.name "enterprise") }} {{ $influxdb3CloudServerless := dict "influxdb3/cloud-serverless" (slice $.Site.Data.products.influxdb3_cloud_serverless.name "cloud-serverless") }} {{ $influxdb3CloudDedicated := dict "influxdb3/cloud-dedicated" (slice $.Site.Data.products.influxdb3_cloud_dedicated.name "cloud-dedicated") }} {{ $influxdb3Clustered := dict "influxdb3/clustered" (slice $.Site.Data.products.influxdb3_clustered.name "clustered") }} {{ $telegraf := dict "telegraf/v1" (slice "Telegraf" "telegraf") }} {{ $chronograf := dict "chronograf/v1" (slice "Chronograf" "chronograf") }} {{ $kapacitor := dict "kapacitor/v1" (slice "Kapacitor" "kapacitor") }} {{ $flux := dict "flux/v0" (slice "Flux" "flux") }} {{ $enterpriseInfluxdb := dict "enterprise_influxdb/v1" (slice "InfluxDB Enterprise" "enterprise_v1") }} {{ $productInfo := merge $influxdbOSSv1 $influxdbOSSv2 $influxdbCloud $influxdb3Core $influxdb3Enterprise $influxdb3CloudServerless $influxdb3CloudDedicated $influxdb3Clustered $telegraf $chronograf $kapacitor $flux $enterpriseInfluxdb }} {{ define "productLink" }} {{ $defaultAltProductPage := $.context.GetPage ((replaceRE .pageRoot .productPath $.context.Page.RelPermalink) | replaceRE `\/$` "") }} {{ $defaultAltProductPageExists := gt (len $defaultAltProductPage.Title) 0 }} {{ $productName := index (index $.productInfo .productPath) 0 }} {{ $productAltLinkKey := index (index $.productInfo .productPath) 1 }} {{ $isCurrentProduct := in $.context.RelPermalink .productPath }} {{ $link := cond .useRootProductLink (print "/" .productPath "/") (cond (isset .altLinks $productAltLinkKey) (index .altLinks $productAltLinkKey) (cond $defaultAltProductPageExists $defaultAltProductPage.RelPermalink (print "/" .productPath "/"))) }} {{ $isNew := in (slice "influxdb3/core" "influxdb3/enterprise") .productPath }} {{ index (index $.productInfo .productPath) 0 }}{{ if $isNew }} New{{ end }} {{ end }} {{ $templateDefaults := dict "context" . "productInfo" $productInfo "altLinks" $altLinks "pageRoot" $pageRoot "useRootProductLink" $useRootProductLink }}

{{ index (index $productInfo $pageRoot) 0 | default "Select product" }}