{{ $productPathData := findRE "[^/]+.*?" .Page.RelPermalink }} {{ $cloudVersion := index $productPathData 1 }} {{ $pathReplacement := print "/influxdb/v2/" }} {{ $relPath := .Get 0 | default "" }} {{ $path := cond (eq $relPath "") (replaceRE `(?U)^influxdb\/cloud.*\/` $pathReplacement .Page.File.Path) (print $pathReplacement (replaceRE `^\/` "" $relPath))}} {{ $page := .Site.GetPage $path }} {{ with $page }} {{ .Content | replaceRE `\/influxdb\/v2/` (print "/influxdb/" $cloudVersion "/") | replaceRE `.*<\/span>` "Cloud" | safeHTML }} {{ end }}