docs-v2/layouts/shortcodes/cloud-name.html

18 lines
745 B
HTML

{{- $productPathData := findRE "[^/]+.*?" .Page.RelPermalink -}}
{{- $currentCloud := index $productPathData 1 -}}
{{- $length := .Get 0 | default "long" -}}
{{- $scratch := newScratch -}}
{{- if eq $currentCloud "cloud" -}}
{{- $scratch.Set "cloudData" .Site.Data.products.influxdb_cloud -}}
{{- else if eq $currentCloud "cloud-serverless" -}}
{{- $scratch.Set "cloudData" .Site.Data.products.influxdb_cloud_serverless -}}
{{- else if eq $currentCloud "cloud-dedicated" -}}
{{- $scratch.Set "cloudData" .Site.Data.products.influxdb_cloud_dedicated -}}
{{- end -}}
{{- $cloudData := $scratch.Get "cloudData" -}}
{{- if eq $length "long" }}
{{- $cloudData.name -}}
{{ else if eq $length "short" }}
{{- $cloudData.altname -}}
{{ end -}}