33 lines
1.7 KiB
HTML
33 lines
1.7 KiB
HTML
{{- $productPathData := findRE "[^/]+.*?" .Page.RelPermalink -}}
|
|
{{- /* Support deployments (such as CI tools) with subdirectory baseURL */ -}}
|
|
{{- $pathOffset := .Site.Params.prPreviewPathOffset | default 0 -}}
|
|
{{- $currentProduct := index $productPathData (add $pathOffset 1) -}}
|
|
{{- $length := .Get 0 | default "long" -}}
|
|
{{- $omit := .Get "omit" | default "" -}}
|
|
{{- $scratch := newScratch -}}
|
|
{{- if eq $currentProduct "v2" -}}
|
|
{{- $scratch.Set "productData" .Site.Data.products.influxdb -}}
|
|
{{- else if eq $currentProduct "cloud" -}}
|
|
{{- $scratch.Set "productData" .Site.Data.products.influxdb_cloud -}}
|
|
{{- else if eq $currentProduct "core" -}}
|
|
{{- $scratch.Set "productData" .Site.Data.products.influxdb3_core -}}
|
|
{{- else if eq $currentProduct "enterprise" -}}
|
|
{{- $scratch.Set "productData" .Site.Data.products.influxdb3_enterprise -}}
|
|
{{- else if eq $currentProduct "explorer" -}}
|
|
{{- $scratch.Set "productData" .Site.Data.products.influxdb3_explorer -}}
|
|
{{- else if eq $currentProduct "cloud-serverless" -}}
|
|
{{- $scratch.Set "productData" .Site.Data.products.influxdb3_cloud_serverless -}}
|
|
{{- else if eq $currentProduct "cloud-dedicated" -}}
|
|
{{- $scratch.Set "productData" .Site.Data.products.influxdb3_cloud_dedicated -}}
|
|
{{- else if eq $currentProduct "clustered" -}}
|
|
{{- $scratch.Set "productData" .Site.Data.products.influxdb3_clustered -}}
|
|
{{- else if eq $currentProduct "controller" -}}
|
|
{{- $scratch.Set "productData" .Site.Data.products.telegraf_controller -}}
|
|
{{- end -}}
|
|
{{- $productData := $scratch.Get "productData" -}}
|
|
{{- if eq $length "long" }}
|
|
{{- $productData.name | replaceRE $omit "" -}}
|
|
{{ else if eq $length "short" }}
|
|
{{- $productData.altname | replaceRE $omit "" -}}
|
|
{{ end -}}
|