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 4a8bfb9 commit a11a0a1Copy full SHA for a11a0a1
layouts/partials/sidebar-v2.html
@@ -19,8 +19,13 @@
19
{{ range $group := . }}
20
{{ range $product := $group.products }}
21
{{ if not $product.extUrl }}
22
- {{ $escaped := replace $product.url "/" "\\/" }}
+ <!-- Remove any leading or trailing slashes for capture group handling -->
23
+ {{ $escaped := strings.TrimPrefix "/" $product.url }}
24
+ {{ $escaped = strings.TrimSuffix "/" $escaped }}
25
+
26
+ {{ $escaped = replace $escaped "/" "\\/" }}
27
{{ $pattern := printf "/(%s)/" $escaped }}
28
29
{{ if strings.FindRE $pattern $normalizedPath }}
30
{{ $currentProductTitle = $product.title }}
31
{{ end }}
0 commit comments