{{- $productPathData := findRE "[^/]+.*?" .Page.RelPermalink -}} {{- $currentVersion := index $productPathData 1 -}} {{- $endpoint := .Get "endpoint" -}} {{- $isOSS := ne (len (findRE `^v[0-9]` $currentVersion)) 0 -}} {{- $parsedProductKey := cond $isOSS "oss" $currentVersion -}} {{- $productKey := .Get "influxdb_host" | default $parsedProductKey -}} {{- $productAliases := dict "oss" "influxdb" "cloud" "influxdb_cloud" "cloud-tsm" "influxdb_cloud" "cloud-serverless" "influxdb_cloud_serverless" "serverless" "influxdb_cloud_serverless" "cloud-dedicated" "influxdb_cloud_dedicated" "dedicated" "influxdb_cloud_dedicated" "clustered" "influxdb_clustered" -}} {{- $productRef := index $productAliases $productKey -}} {{- $productData := index .Site.Data.products $productRef -}} {{- $placeholderHost := $productData.placeholder_host }} {{- $method := .Get "method" | upper -}} {{- $methodStyle := .Get "method" | lower -}} {{- $apiRef := .Get "api-ref" | default "" -}} {{- $renderedEndpoint := $endpoint | replaceRE `\{\{[<%] influxdb/host .*[>%]\}\}` $placeholderHost -}}
  {{- if ne $apiRef "" -}}
  {{ $method }} {{ $renderedEndpoint }}
  {{- else -}}
  {{ $method }} {{ $renderedEndpoint }}
  {{- end -}}