Skip to content

Commit f5abced

Browse files
authored
Merge pull request #376 from nginxinc/fix-product-path-matching
ProductSelector: Fix product matching
2 parents 7e6439f + 25ba583 commit f5abced

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

layouts/partials/sidebar-v2.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
</label>
1010
</div>
1111

12-
{{ $relPermalink := .RelPermalink | strings.TrimPrefix "/" | strings.TrimSuffix "/" }}
12+
{{ $relPermalink := .RelPermalink }}
1313
{{ $currentProductTitle := "" }}
1414

1515
{{ with index .Site.Data "product-selector" }}
1616
{{ range $group := . }}
1717
{{ range $product := $group.products }}
1818
{{ if not $product.extUrl }}
19-
{{ $productUrl := $product.url | strings.TrimPrefix "/" | strings.TrimSuffix "/" }}
20-
{{ if eq $productUrl $relPermalink }}
19+
{{ warnf "$relPermalink: %s" $relPermalink }}
20+
{{ warnf "$product.url: %s" $product.url }}
21+
{{ if strings.Contains $relPermalink $product.url }}
2122
{{ $currentProductTitle = $product.title }}
2223
{{ end }}
2324
{{ end }}

0 commit comments

Comments
 (0)