@redpanda-data/docs-extensions-and-macros 4.7.3 → 4.7.4
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.
|
@@ -178,19 +178,30 @@ function generateIndex (playbook, contentCatalog, { indexLatestOnly = false, exc
|
|
|
178
178
|
let tag;
|
|
179
179
|
const title = (component.title || '').trim();
|
|
180
180
|
if (title.toLowerCase() === 'home') {
|
|
181
|
-
// Collect all unique component titles except 'home' using public API when available
|
|
181
|
+
// Collect all unique component titles except 'home', 'shared', 'search' using public API when available
|
|
182
182
|
const componentsList = typeof contentCatalog.getComponents === 'function'
|
|
183
183
|
? contentCatalog.getComponents()
|
|
184
184
|
: Array.isArray(contentCatalog.components)
|
|
185
185
|
? contentCatalog.components
|
|
186
186
|
: Object.values(contentCatalog.components || contentCatalog._components || {});
|
|
187
|
+
// Find the latest version for Self-Managed (component title: 'Self-Managed')
|
|
188
|
+
let latestVersion = undefined;
|
|
189
|
+
const selfManaged = componentsList.find(c => (c.title || '').trim().toLowerCase() === 'self-managed');
|
|
190
|
+
if (selfManaged && selfManaged.latest && selfManaged.latest.version) {
|
|
191
|
+
latestVersion = selfManaged.latest.version;
|
|
192
|
+
if (latestVersion && !/^v/.test(latestVersion)) latestVersion = 'v' + latestVersion;
|
|
193
|
+
}
|
|
187
194
|
const allComponentTitles = componentsList
|
|
188
195
|
.map(c => (c.title || '').trim())
|
|
189
|
-
.filter(t => t && t.toLowerCase()
|
|
196
|
+
.filter(t => t && !['home', 'shared', 'search'].includes(t.toLowerCase()));
|
|
190
197
|
if (!allComponentTitles.length) {
|
|
191
198
|
throw new Error('No component titles found for "home" page. Indexing aborted.');
|
|
192
199
|
}
|
|
193
200
|
tag = [...new Set(allComponentTitles)];
|
|
201
|
+
// For Self-Managed, append v<latest-version> to the tag
|
|
202
|
+
if (latestVersion) {
|
|
203
|
+
tag = tag.map(t => t.toLowerCase() === 'self-managed' ? `${t} ${latestVersion}` : t);
|
|
204
|
+
}
|
|
194
205
|
} else {
|
|
195
206
|
tag = `${title}${version ? ' v' + version : ''}`;
|
|
196
207
|
}
|