Skip to content

Commit

Permalink
Merge pull request #395 from vishalvivekm/partial-update
Browse files Browse the repository at this point in the history
Partial update
  • Loading branch information
vishalvivekm authored Oct 20, 2024
2 parents bacdc7d + 65045dc commit e640cb6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions layouts/docs/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ <h1>{{ .Title }}</h1>
{{ with .Params.plan }}
{{ partial "plan-info.html" (dict "plan" .) }}
{{ end }}
{{- partial "feature-info.html" . -}}
{{ .Content }}
{{ partial "section-index.html" . -}}

Expand Down
1 change: 1 addition & 0 deletions layouts/docs/single.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ define "main" }}
{{ partial "feature-info.html" . }}
{{ .Render "content" }}
{{ end }}
25 changes: 25 additions & 0 deletions layouts/partials/feature-info.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{ $currentPage := .Page.Permalink }}
{{ $features := .Site.Data.features }}

{{ if not $features }}
{{ $features = getJSON "features.json" }}
{{ end }}

{{ if $features }}
{{ range $features }}
{{ $docUrl := .documentation | default "" }}
{{ $cleanDocUrl := (index (split $docUrl "#") 0) }} <!-- Remove the # fragment if it exists -->
{{ if eq $cleanDocUrl $currentPage }}
<div class="matterinfo">
<h4 class="matterheader">Who can use this feature</h4>
{{ $subscription_tier := index .entire_row "Subscription Tier" }}
<div class="plan-support all-plans {{ lower $subscription_tier }}-plan">
<img src="/images/subscription.svg" alt="Icon" class="support-icon adaptive-icon">
Supported on <span class="tier">{{ $subscription_tier }}</span> Plan
</div>
</div>
{{ break }}
{{ end }}
{{ end }}
{{ end }}

0 comments on commit e640cb6

Please sign in to comment.