{{ $currentPage := . }} {{ $productPathData := findRE "[^/]+.*?" .RelPermalink }} {{ $product := index $productPathData 0 }} {{ $productName := (index .Site.Data.products $product).name }} {{ $currentVersion := index $productPathData 1 }} {{ .Scratch.Set "menuKey" "menu"}} {{ if eq $product "platform" }} {{ .Scratch.Set "menuKey" "platform" }} {{ else if eq $product "resources" }} {{ .Scratch.Set "menuKey" "resources" }} {{ else if in $currentVersion "serverless" }} {{ .Scratch.Set "menuKey" "influxdb_cloud_serverless" }} {{ else if in $currentVersion "dedicated" }} {{ .Scratch.Set "menuKey" "influxdb_cloud_dedicated" }} {{ else if eq $currentVersion "clustered" }} {{ .Scratch.Set "menuKey" "influxdb_clustered" }} {{ else }} {{ .Scratch.Set "menuKey" (print $product "_" $currentVersion) }} {{ end }} {{ $menuKey := .Scratch.Get "menuKey" }} {{ .Scratch.Set "searchPlaceholder" "Search"}} {{ $fluxBlacklist := slice "cloud-serverless" "cloud-dedicated" "clustered" }} {{ $influxdbProductKey := print "influxdb_" (replaceRE "-" "_" $currentVersion) }} {{ if and (eq (index .Site.Data.products $product).name nil) (eq (len (findRE `v[1-2]` $currentVersion nil)) 0) }} {{ .Scratch.Set "searchPlaceholder" "Search the docs" }} {{ else if (eq $currentVersion nil) }} {{ .Scratch.Set "searchPlaceholder" (print "Search " (index .Site.Data.products $product).name) }} {{ else if eq $product "influxdb" }} {{ if not (in $fluxBlacklist $currentVersion) }} {{ .Scratch.Set "searchPlaceholder" (print "Search " (index .Site.Data.products $product).name " " (cond (in $currentVersion "v") $currentVersion (title $currentVersion)) " & Flux") }} {{ else }} {{ .Scratch.Set "searchPlaceholder" (print "Search " (index .Site.Data.products $influxdbProductKey).name) }} {{ end }} {{ else }} {{ .Scratch.Set "searchPlaceholder" (print "Search " (index .Site.Data.products $product).name) }} {{ end }} {{ $searchPlaceholder := .Scratch.Get "searchPlaceholder" }}