Skip to content

Commit 08c1722

Browse files
committed
fix(ci): add path offset for PR preview subdirectory baseURL (#6662)
When PR preview builds use a subdirectory baseURL like /docs-v2/pr-preview/pr-XXXX/, shortcodes that parse .RelPermalink to detect product context fail because the path has extra segments. This fix: - Adds config/pr-preview/params.yml with prPreviewPathOffset: 3 - Updates workflow to use -e pr-preview environment - Updates api-endpoint, influxdb/host, and children shortcodes to use the offset when indexing path segments - Adds nil-safety with default fallback for placeholder_host Normal builds are unaffected (offset defaults to 0).
1 parent c7c2498 commit 08c1722

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

layouts/shortcodes/api-endpoint.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
{{- $productAliases := dict "oss" "influxdb" "cloud" "influxdb_cloud" "cloud-tsm" "influxdb_cloud" "core" "influxdb3_core" "enterprise" "influxdb3_enterprise" "cloud-serverless" "influxdb3_cloud_serverless" "serverless" "influxdb3_cloud_serverless" "cloud-dedicated" "influxdb3_cloud_dedicated" "dedicated" "influxdb3_cloud_dedicated" "clustered" "influxdb3_clustered" -}}
1010
{{- $productRef := index $productAliases $productKey | default "influxdb" -}}
1111
{{- $productData := index .Site.Data.products $productRef -}}
12-
{{- $placeholderHost := "" -}}
12+
{{- $placeholderHost := "localhost:8086" -}}
1313
{{- with $productData -}}
14-
{{- $placeholderHost = .placeholder_host -}}
14+
{{- $placeholderHost = .placeholder_host | default "localhost:8086" -}}
1515
{{- end -}}
1616
{{- $method := .Get "method" | upper -}}
1717
{{- $methodStyle := .Get "method" | lower -}}

0 commit comments

Comments
 (0)