We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5365191 commit 6a149aeCopy full SHA for 6a149ae
layouts/partials/sidebar-v2.html
@@ -9,7 +9,10 @@
9
</label>
10
</div>
11
12
- {{ $relPermalink := (urls.Parse .RelPermalink).Path }}
+ <!-- Normalize our URL path to handle preview environments -->
13
+ {{ $rawPath := strings.TrimPrefix .Site.BaseURL .Permalink }}
14
+ {{ $normalizedPath := printf "/%s" $rawPath }}
15
+
16
{{ $currentProductTitle := "" }}
17
18
{{ with index .Site.Data "product-selector" }}
@@ -18,7 +21,7 @@
21
{{ if not $product.extUrl }}
19
22
{{ $escaped := replace $product.url "/" "\\/" }}
20
23
{{ $pattern := printf "/%s(|$)" $escaped }}
- {{ if strings.FindRE $pattern $relPermalink }}
24
+ {{ if strings.FindRE $pattern $normalizedPath }}
25
{{ $currentProductTitle = $product.title }}
26
{{ end }}
27
0 commit comments