File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 9
9
</ label >
10
10
</ div >
11
11
12
- {{ $relPermalink := .RelPermalink }}
13
- {{ $productIdentifier := index ((split $relPermalink "/")) 1 }}
14
- {{ $relPermalink := strings.TrimSuffix "/" $productIdentifier }}
12
+ {{ $relPermalink := .RelPermalink | strings.TrimPrefix "/" | strings.TrimSuffix "/" }}
15
13
{{ $currentProductTitle := "" }}
16
14
17
15
{{ with index .Site.Data "product-selector" }}
18
16
{{ range $group := . }}
19
17
{{ range $product := $group.products }}
20
- {{ $splitProductUrl := index ((split $product.url "/")) 1 }}
21
- {{ $suffixProductUrl := strings.TrimSuffix "/" $splitProductUrl | }}
22
- {{ $prefixProductUrl := strings.TrimPrefix "/" $suffixProductUrl | }}
23
- {{ if (eq $prefixProductUrl $productIdentifier) }}
24
- {{ $currentProductTitle = $product.title }}
18
+ {{ if not $product.extUrl }}
19
+ {{ $productUrl := $product.url | strings.TrimPrefix "/" | strings.TrimSuffix "/" }}
20
+ {{ if eq $productUrl $relPermalink }}
21
+ {{ $currentProductTitle = $product.title }}
22
+ {{ end }}
25
23
{{ end }}
26
24
{{ end }}
27
25
{{ end }}
You can’t perform that action at this time.
0 commit comments