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 }} {{ partial "lucide" (dict "context" . "icon" "chevron-right") }} @@ -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 }}