Skip to content

Commit 517b52b

Browse files
paulOsinskiclaude
andcommitted
Restrict Pro sidebar badge to parent pages with children
Only render the Pro badge in the <summary> of folders backed by an _index.md (i.e., pages with child pages); leaf article links no longer carry the badge. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 10036bb commit 517b52b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

docs/layouts/_partials/sidebar/render-section-menu.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
{{- $linkContent = . }}
3232
{{- end }}
3333

34-
{{- /* Pro badge for nodes whose page is marked audience: pro */ -}}
34+
{{- /* Pro badge for parent pages (from _index.md with child pages) marked audience: pro */ -}}
3535
{{- $proBadge := "" -}}
3636
{{- with $node.Page }}
37-
{{- if eq .Params.audience "pro" }}
37+
{{- if and (eq .Params.audience "pro") .Pages }}
3838
{{- $proBadge = `<span class="pro-badge" aria-label="Pro feature">Pro</span>` -}}
3939
{{- end }}
4040
{{- end }}
@@ -64,7 +64,7 @@
6464
</details>
6565
{{- else }}
6666
{{- if $node.Page }}
67-
<a {{- with $ariaCurrent }} aria-current="{{ . }}" {{- end }} href="{{- $node.Page.RelPermalink }}">{{ $linkContent }}{{ $proBadge | safeHTML }}</a>
67+
<a {{- with $ariaCurrent }} aria-current="{{ . }}" {{- end }} href="{{- $node.Page.RelPermalink }}">{{ $linkContent }}</a>
6868
{{- else }}
6969
{{- /* Menu-only item with no page */ -}}
7070
{{ $linkContent }}

0 commit comments

Comments
 (0)