File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 9
9
</ label >
10
10
</ div >
11
11
12
- {{ $relPermalink := . RelPermalink }}
12
+ {{ $relPermalink := (urls.Parse . RelPermalink).Path }}
13
13
{{ $currentProductTitle := "" }}
14
14
15
15
{{ with index .Site.Data "product-selector" }}
16
16
{{ range $group := . }}
17
17
{{ range $product := $group.products }}
18
18
{{ if not $product.extUrl }}
19
- {{ warnf "$relPermalink: %s" $relPermalink }}
20
- {{ warnf "$product.url: %s " $product.url }}
21
- {{ if strings.Contains $relPermalink $product.url }}
19
+ {{ $escaped := replace $product.url "/" "\\/" }}
20
+ {{ $pattern := printf "/%s(/|$) " $escaped }}
21
+ {{ if strings.FindRE $pattern $relPermalink }}
22
22
{{ $currentProductTitle = $product.title }}
23
23
{{ end }}
24
24
{{ end }}
27
27
{{ end }}
28
28
29
29
30
+
30
31
< div class ="product-selector ">
31
32
< details class ="product-selector__section ">
32
33
< summary class ="product-selector__toggle ">
You can’t perform that action at this time.
0 commit comments