Skip to content

Commit 2128bba

Browse files
committed
Commercial: Add partial for commercial features
1 parent fe821ae commit 2128bba

File tree

5 files changed

+36
-3
lines changed

5 files changed

+36
-3
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: Commercial
3+
description: Highlighting commerical pages
4+
---
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Commercial Feature
3+
description: Commercial Feature
4+
nd-commercial: true
5+
---
6+
7+
The sidebar for this item should contain _Commercial_ to signifiy that it requires a comemrical subscription.
8+
9+
This is managed by the `nd-commercial: true` in the frontmatter.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: Partial Commercial Feature
3+
description: Partial Commercial Feature
4+
nd-commercial-partial: true
5+
---
6+
7+
The sidebar for this item should contain _Partial Commercial_ to signifiy that it requires a commercial subscription
8+
for a part of this page.
9+
10+
For example, a module may have specific features or directives within, that
11+
require a commercial subscription, but the module itself can be used without it.
12+
13+
This is managed by the `nd-commercial-partial: true` in the frontmatter.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{ with .Params }}
2+
{{ if (index . "nd-commercial") }}
3+
- <em>Commercial</em>
4+
{{ else if (index . "nd-commercial-partial") }}
5+
- <em>Partial Commercial</em>
6+
{{ end }}
7+
{{ end }}

layouts/partials/sidebar-list.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
aria-controls="{{ $tocID }}"
6666
id="{{ $linkID }}"
6767
>
68-
<span>{{ $p.Title }}</span>
68+
<span>{{ $p.Title }} {{ partial "commercial-feature.html" $p }}</span>
6969
<span class="sidebar__chevron sidebar__chevron--open">
7070
{{ partial "lucide" (dict "context" . "icon" "chevron-right") }}
7171
</span>
@@ -86,11 +86,11 @@
8686
class="sidebar__link {{ if $onPage }}sidebar__link--current{{ end }}"
8787
{{ if $onPage }}aria-current="page"{{ end }}
8888
>
89-
{{ $p.Title }}
89+
<span>{{ $p.Title }} {{ partial "commercial-feature.html" $p }}</span>
9090
</a>
9191
{{ end }}
9292
</li>
9393
{{ end }}
9494
{{ end }}
9595
</ul>
96-
{{ end }}
96+
{{ end }}

0 commit comments

Comments
 (0)