@redpanda-data/docs-extensions-and-macros 4.7.2 → 4.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -175,7 +175,25 @@ function generateIndex (playbook, contentCatalog, { indexLatestOnly = false, exc
|
|
|
175
175
|
.replace(/\s+/g, ' ')
|
|
176
176
|
.trim();
|
|
177
177
|
|
|
178
|
-
|
|
178
|
+
let tag;
|
|
179
|
+
const title = (component.title || '').trim();
|
|
180
|
+
if (title.toLowerCase() === 'home') {
|
|
181
|
+
// Collect all unique component titles except 'home' using public API when available
|
|
182
|
+
const componentsList = typeof contentCatalog.getComponents === 'function'
|
|
183
|
+
? contentCatalog.getComponents()
|
|
184
|
+
: Array.isArray(contentCatalog.components)
|
|
185
|
+
? contentCatalog.components
|
|
186
|
+
: Object.values(contentCatalog.components || contentCatalog._components || {});
|
|
187
|
+
const allComponentTitles = componentsList
|
|
188
|
+
.map(c => (c.title || '').trim())
|
|
189
|
+
.filter(t => t && t.toLowerCase() !== 'home');
|
|
190
|
+
if (!allComponentTitles.length) {
|
|
191
|
+
throw new Error('No component titles found for "home" page. Indexing aborted.');
|
|
192
|
+
}
|
|
193
|
+
tag = [...new Set(allComponentTitles)];
|
|
194
|
+
} else {
|
|
195
|
+
tag = `${title}${version ? ' v' + version : ''}`;
|
|
196
|
+
}
|
|
179
197
|
var indexItem;
|
|
180
198
|
const deployment = page.asciidoc?.attributes['env-kubernetes'] ? 'Kubernetes' : page.asciidoc?.attributes['env-linux'] ? 'Linux' : page.asciidoc?.attributes['env-docker'] ? 'Docker' : page.asciidoc?.attributes['page-cloud'] ? 'Redpanda Cloud' : ''
|
|
181
199
|
|
|
@@ -198,12 +216,12 @@ function generateIndex (playbook, contentCatalog, { indexLatestOnly = false, exc
|
|
|
198
216
|
indexItem.product = component.title;
|
|
199
217
|
indexItem.breadcrumbs = breadcrumbs;
|
|
200
218
|
indexItem.type = 'Doc';
|
|
201
|
-
indexItem._tags = [tag];
|
|
219
|
+
indexItem._tags = Array.isArray(tag) ? tag : [tag];
|
|
202
220
|
} else {
|
|
203
221
|
indexItem.deployment = deployment;
|
|
204
222
|
indexItem.type = 'Lab';
|
|
205
223
|
indexItem.interactive = false;
|
|
206
|
-
indexItem._tags = [tag];
|
|
224
|
+
indexItem._tags = Array.isArray(tag) ? tag : [tag];
|
|
207
225
|
}
|
|
208
226
|
algolia[cname][version].push(indexItem)
|
|
209
227
|
algoliaCount++
|