From 2128bba70348fc5eae31ae2718a7c0ecd3835577 Mon Sep 17 00:00:00 2001
From: Jack Hickey <133868041+nginx-jack@users.noreply.github.com>
Date: Thu, 4 Sep 2025 10:45:24 +0100
Subject: [PATCH] Commercial: Add partial for commercial features
---
.../content/test-product/commerical/_index.md | 4 ++++
.../test-product/commerical/commercial-feature.md | 9 +++++++++
.../commerical/partial-commercial-feature.md | 13 +++++++++++++
layouts/partials/commercial-feature.html | 7 +++++++
layouts/partials/sidebar-list.html | 6 +++---
5 files changed, 36 insertions(+), 3 deletions(-)
create mode 100644 exampleSite/content/test-product/commerical/_index.md
create mode 100644 exampleSite/content/test-product/commerical/commercial-feature.md
create mode 100644 exampleSite/content/test-product/commerical/partial-commercial-feature.md
create mode 100644 layouts/partials/commercial-feature.html
diff --git a/exampleSite/content/test-product/commerical/_index.md b/exampleSite/content/test-product/commerical/_index.md
new file mode 100644
index 00000000..ec8600d4
--- /dev/null
+++ b/exampleSite/content/test-product/commerical/_index.md
@@ -0,0 +1,4 @@
+---
+title: Commercial
+description: Highlighting commerical pages
+---
diff --git a/exampleSite/content/test-product/commerical/commercial-feature.md b/exampleSite/content/test-product/commerical/commercial-feature.md
new file mode 100644
index 00000000..0f666c9f
--- /dev/null
+++ b/exampleSite/content/test-product/commerical/commercial-feature.md
@@ -0,0 +1,9 @@
+---
+title: Commercial Feature
+description: Commercial Feature
+nd-commercial: true
+---
+
+The sidebar for this item should contain _Commercial_ to signifiy that it requires a comemrical subscription.
+
+This is managed by the `nd-commercial: true` in the frontmatter.
diff --git a/exampleSite/content/test-product/commerical/partial-commercial-feature.md b/exampleSite/content/test-product/commerical/partial-commercial-feature.md
new file mode 100644
index 00000000..33517131
--- /dev/null
+++ b/exampleSite/content/test-product/commerical/partial-commercial-feature.md
@@ -0,0 +1,13 @@
+---
+title: Partial Commercial Feature
+description: Partial Commercial Feature
+nd-commercial-partial: true
+---
+
+The sidebar for this item should contain _Partial Commercial_ to signifiy that it requires a commercial subscription
+for a part of this page.
+
+For example, a module may have specific features or directives within, that
+require a commercial subscription, but the module itself can be used without it.
+
+This is managed by the `nd-commercial-partial: true` in the frontmatter.
diff --git a/layouts/partials/commercial-feature.html b/layouts/partials/commercial-feature.html
new file mode 100644
index 00000000..0642888f
--- /dev/null
+++ b/layouts/partials/commercial-feature.html
@@ -0,0 +1,7 @@
+{{ with .Params }}
+ {{ if (index . "nd-commercial") }}
+ - Commercial
+ {{ else if (index . "nd-commercial-partial") }}
+ - Partial Commercial
+ {{ end }}
+{{ end }}
diff --git a/layouts/partials/sidebar-list.html b/layouts/partials/sidebar-list.html
index 10a7e663..49749e43 100644
--- a/layouts/partials/sidebar-list.html
+++ b/layouts/partials/sidebar-list.html
@@ -65,7 +65,7 @@
aria-controls="{{ $tocID }}"
id="{{ $linkID }}"
>
- {{ $p.Title }}
+ {{ $p.Title }} {{ partial "commercial-feature.html" $p }}
@@ -86,11 +86,11 @@
class="sidebar__link {{ if $onPage }}sidebar__link--current{{ end }}"
{{ if $onPage }}aria-current="page"{{ end }}
>
- {{ $p.Title }}
+ {{ $p.Title }} {{ partial "commercial-feature.html" $p }}
{{ end }}
{{ end }}
{{ end }}
-{{ end }}
\ No newline at end of file
+{{ end }}