diff --git a/layouts/partials/feature-info.html b/layouts/partials/feature-info.html index 06cc3924..0d6cb49e 100644 --- a/layouts/partials/feature-info.html +++ b/layouts/partials/feature-info.html @@ -1,21 +1,22 @@ {{ $currentPage := .Page.Permalink }} {{ $features := .Site.Data.features }} - {{ if not $features }} {{ $features = getJSON "features.json" }} {{ end }} - {{ if $features }} {{ $groupedFeatures := dict }} {{ range $features }} {{ $docUrl := .documentation | default "" }} {{ $cleanDocUrl := (index (split $docUrl "#") 0) }} -{{ if eq $cleanDocUrl $currentPage }} +{{ $currentPagePath := path.Clean (urls.Parse $currentPage).Path }} +{{ $cleanDocUrlPath := path.Clean (urls.Parse $cleanDocUrl).Path }} + +{{ if eq $cleanDocUrlPath $currentPagePath }} {{ $tier := index .entire_row "Subscription Tier" }} {{ $feature := index .entire_row "Feature" }} {{ $currentFeatures := index $groupedFeatures $tier | default "" }} -{{ $groupedFeatures = merge $groupedFeatures (dict $tier (printf "%s%s%s" $currentFeatures (cond (eq $currentFeatures -"") "" ", ") $feature)) }} +{{ $groupedFeatures = merge $groupedFeatures (dict $tier (printf "%s%s%s" $currentFeatures (cond (eq $currentFeatures "") "" ", ") $feature)) }} + {{ end }} {{ end }} @@ -34,10 +35,8 @@