Skip to content

Commit 80dca4d

Browse files
authored
Merge pull request #385 from nginxinc/module-ref-plus
Commercial: Add partial for commercial features
2 parents 822077a + 2128bba commit 80dca4d

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
@@ -66,7 +66,7 @@
6666
aria-controls="{{ $tocID }}"
6767
id="{{ $linkID }}"
6868
>
69-
<span>{{ $p.Title }}</span>
69+
<span>{{ $p.Title }} {{ partial "commercial-feature.html" $p }}</span>
7070
<span class="sidebar__chevron sidebar__chevron--open">
7171
{{ partial "lucide" (dict "context" . "icon" "chevron-right") }}
7272
</span>
@@ -87,11 +87,11 @@
8787
class="sidebar__link {{ if $onPage }}sidebar__link--current{{ end }}"
8888
{{ if $onPage }}aria-current="page"{{ end }}
8989
>
90-
{{ $p.Title }}
90+
<span>{{ $p.Title }} {{ partial "commercial-feature.html" $p }}</span>
9191
</a>
9292
{{ end }}
9393
</li>
9494
{{ end }}
9595
{{ end }}
9696
</ul>
97-
{{ end }}
97+
{{ end }}

0 commit comments

Comments
 (0)