Skip to content

Commit 30917d0

Browse files
committed
Add BYOC and Cloud platform badges for ADP documentation
Adds inline status badges in the sticky header for ADP pages when features are limited to specific platforms: - "Only in BYOC" badge when :page-byoc-only: true is set - "Only in Cloud" badge when :page-cloud-only: true is set Both attributes require :adp: true (set in ADP component antora.yml). Badges are mutually exclusive - set only one. Also includes: - Version dropdown alignment fix (aligns left with button) - Removed the availability block in favor of compact inline badges
1 parent 0653386 commit 30917d0

2 files changed

Lines changed: 39 additions & 48 deletions

File tree

src/css/doc.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,12 @@ html[data-theme="dark"] .component-indicator-sticky .sm-ver-pill-caret {
201201
color: rgba(255, 255, 255, 0.65);
202202
}
203203

204+
/* Version dropdown panel positioning in sticky header - align left with button */
205+
.component-indicator-sticky .sm-ver-panel {
206+
left: 0;
207+
right: auto;
208+
}
209+
204210
/* Status badges (Beta, Limited Availability) in sticky header */
205211
.status-badge {
206212
display: inline-flex;
@@ -243,6 +249,20 @@ html[data-theme="dark"] .status-badge--la {
243249
border-color: rgba(139, 92, 246, 0.3);
244250
}
245251

252+
.status-badge--byoc,
253+
.status-badge--cloud {
254+
background: #e0f2fe;
255+
color: #0369a1;
256+
border: 1px solid #7dd3fc;
257+
}
258+
259+
html[data-theme="dark"] .status-badge--byoc,
260+
html[data-theme="dark"] .status-badge--cloud {
261+
background: rgba(14, 165, 233, 0.15);
262+
color: #7dd3fc;
263+
border-color: rgba(14, 165, 233, 0.3);
264+
}
265+
246266
@media screen and (min-width: 600px) {
247267
.doc .openblock.side-by-side > .content {
248268
display: flex;

src/partials/article.hbs

Lines changed: 19 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,32 @@
4141
Limited Availability
4242
</span>
4343
{{/if}}
44+
{{!-- ADP platform badges: only show when limited to one platform --}}
45+
{{#if page.attributes.adp}}
46+
{{#if page.attributes.byoc-only}}
47+
<span class="status-badge status-badge--byoc" data-tippy-content="This feature is only available in BYOC (Bring Your Own Cloud) clusters.">
48+
<svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
49+
<path d="M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z"/>
50+
</svg>
51+
Only in BYOC
52+
</span>
53+
{{else if page.attributes.cloud-only}}
54+
<span class="status-badge status-badge--cloud" data-tippy-content="This feature is only available in fully managed Redpanda Cloud clusters.">
55+
<svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
56+
<path d="M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z"/>
57+
</svg>
58+
Only in Cloud
59+
</span>
60+
{{/if}}
61+
{{/if}}
4462
</div>
4563
{{#with page.title}}
4664
<h1 class="page">{{{this}}}</h1>
4765
{{/with}}
4866
{{/if}}
4967
{{#unless (or (eq page.attributes.role 'component-home-v2') (eq page.attributes.role 'component-home-v3'))}}
5068
<div class="metadata metadata--main">
51-
{{!-- Only show BYOC/Cloud badges on non-ADP pages (ADP uses availability block instead) --}}
69+
{{!-- Only show BYOC/Cloud badges on non-ADP pages (ADP uses inline status badges instead) --}}
5270
{{#unless page.attributes.adp}}
5371
{{#if page.attributes.byoc}}
5472
<div class="byoc-label">
@@ -72,53 +90,6 @@
7290
{{> markdown-dropdown}}
7391
</div>
7492
{{/unless}}
75-
{{!-- Availability block for ADP pages showing platform support --}}
76-
{{#if page.attributes.adp}}
77-
{{#unless (eq page.attributes.role 'component-home-v2')}}
78-
{{#unless (eq page.attributes.role 'component-home-v3')}}
79-
{{#unless (eq page.attributes.role 'home')}}
80-
{{#unless (eq page.layout 'index')}}
81-
<div class="availability-block">
82-
<strong>Available in:</strong>
83-
{{#if (and page.attributes.byoc page.attributes.cloud-only)}}
84-
Cloud, BYOC
85-
{{else if page.attributes.byoc}}
86-
BYOC
87-
{{else if page.attributes.cloud-only}}
88-
Cloud
89-
{{else}}
90-
Cloud, BYOC
91-
{{/if}}
92-
<span class="availability-info" tabindex="0" aria-label="Availability information">
93-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
94-
<circle cx="12" cy="12" r="10"></circle>
95-
<line x1="12" y1="16" x2="12" y2="12"></line>
96-
<line x1="12" y1="8" x2="12.01" y2="8"></line>
97-
</svg>
98-
</span>
99-
</div>
100-
<script>
101-
document.addEventListener("DOMContentLoaded", () => {
102-
const availabilityInfo = document.querySelector(".availability-info");
103-
if (availabilityInfo && typeof tippy !== 'undefined') {
104-
tippy(availabilityInfo, {
105-
content: "This indicates which Redpanda Cloud cluster types support this feature. Cloud refers to fully managed clusters. BYOC (Bring Your Own Cloud) refers to clusters running in your own cloud account.",
106-
animation: "scale",
107-
theme: "redpanda-term",
108-
touch: "hold",
109-
interactive: true,
110-
allowHTML: true,
111-
appendTo: () => document.body,
112-
maxWidth: 300
113-
});
114-
}
115-
});
116-
</script>
117-
{{/unless}}
118-
{{/unless}}
119-
{{/unless}}
120-
{{/unless}}
121-
{{/if}}
12293
{{#if (or page.attributes.beta page.attributes.limited-availability page.attributes.byoc page.attributes.cloud-only page.attributes.context-switcher)}}
12394
<script>
12495
document.addEventListener("DOMContentLoaded", () => {

0 commit comments

Comments
 (0)