1
1
{{ $currentPage := .Page.Permalink }}
2
2
{{ $features := .Site.Data.features }}
3
-
4
3
{{ if not $features }}
5
4
{{ $features = getJSON "features.json" }}
6
5
{{ end }}
7
-
8
6
{{ if $features }}
9
7
{{ $groupedFeatures := dict }}
10
8
{{ range $features }}
11
9
{{ $docUrl := .documentation | default "" }}
12
10
{{ $cleanDocUrl := (index (split $docUrl "#") 0) }}
13
- {{ if eq $cleanDocUrl $currentPage }}
11
+ {{ $currentPagePath := path.Clean (urls.Parse $currentPage).Path }}
12
+ {{ $cleanDocUrlPath := path.Clean (urls.Parse $cleanDocUrl).Path }}
13
+
14
+ {{ if eq $cleanDocUrlPath $currentPagePath }}
14
15
{{ $tier := index .entire_row "Subscription Tier" }}
15
16
{{ $feature := index .entire_row "Feature" }}
16
17
{{ $currentFeatures := index $groupedFeatures $tier | default "" }}
17
- {{ $groupedFeatures = merge $groupedFeatures (dict $tier (printf "%s%s%s" $currentFeatures (cond (eq $currentFeatures
18
- "") "" ", ") $feature)) }}
18
+ {{ $groupedFeatures = merge $groupedFeatures (dict $tier (printf "%s%s%s" $currentFeatures (cond (eq $currentFeatures "") "" ", ") $feature)) }}
19
+
19
20
{{ end }}
20
21
{{ end }}
21
22
34
35
< h4 class ="matterheader "> Who can use this feature</ h4 >
35
36
< div class ="plan-support all-plans {{ lower $maxTier }}-plan ">
36
37
< img src ="/images/subscription.svg " alt ="Icon " class ="support-icon adaptive-icon " data-modal ="false " >
37
- Supported on < a href ="https://layer5.io/pricing " class ="tier-link " target ="_blank "> < span class ="tier "> {{ $maxTier
38
- }}</ span > </ a > Plan
38
+ Supported on < a href ="https://layer5.io/pricing " class ="tier-link " target ="_blank "> < span class ="tier "> {{ $maxTier }}</ span > </ a > Plan
39
39
</ div >
40
-
41
40
{{ if gt (len $groupedFeatures) 1 }}
42
41
< div class ="add-ons ">
43
42
< strong > Add-ons:</ strong >
@@ -46,8 +45,7 @@ <h4 class="matterheader">Who can use this feature</h4>
46
45
{{ if ne $tier $maxTier }}
47
46
{{ if not $first }}, {{ end }}
48
47
{{ $first = false }}
49
- {{ $features }} [< a href ="https://layer5.io/pricing " class ="tier-link " target ="_blank "> < span class ="tier "> {{ $tier
50
- }}</ span > </ a > ]
48
+ {{ $features }} [< a href ="https://layer5.io/pricing " class ="tier-link " target ="_blank "> < span class ="tier "> {{ $tier }}</ span > </ a > ]
51
49
{{ end }}
52
50
{{ end }}
53
51
</ div >
0 commit comments