@redpanda-data/docs-extensions-and-macros 3.1.2 → 3.1.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.
|
@@ -8,6 +8,7 @@ module.exports.register = function ({ config }) {
|
|
|
8
8
|
const yaml = require('js-yaml');
|
|
9
9
|
const logger = this.getLogger('global-attributes-extension');
|
|
10
10
|
const chalk = require('chalk')
|
|
11
|
+
const _ = require('lodash');
|
|
11
12
|
|
|
12
13
|
this.on('contentAggregated', ({ siteCatalog, contentAggregate }) => {
|
|
13
14
|
let attributeFile;
|
|
@@ -28,4 +29,17 @@ module.exports.register = function ({ config }) {
|
|
|
28
29
|
logger.error(`Error loading attributes: ${error.message}`);
|
|
29
30
|
}
|
|
30
31
|
})
|
|
32
|
+
.on('contentClassified', async ({ siteCatalog,contentCatalog }) => {
|
|
33
|
+
const components = await contentCatalog.getComponents();
|
|
34
|
+
for (let i = 0; i < components.length; i++) {
|
|
35
|
+
let component = components[i];
|
|
36
|
+
if (component.name !== 'ROOT' && component.name !== 'preview') continue
|
|
37
|
+
|
|
38
|
+
component.versions.forEach(({asciidoc}) => {
|
|
39
|
+
if (siteCatalog.attributeFile) {
|
|
40
|
+
asciidoc.attributes = _.merge({}, siteCatalog.attributeFile, asciidoc.attributes);
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
})
|
|
31
45
|
}
|
|
@@ -114,7 +114,7 @@ function register({
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
for (const [objectID, obj] of existingObjectsMap) {
|
|
117
|
-
if (obj.type === 'Doc' && !obj._tags.includes('apis')) {
|
|
117
|
+
if (obj.type === 'Doc' && !obj._tags.includes('apis') || !obj.type) {
|
|
118
118
|
objectsToDelete.push(objectID)
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -7,7 +7,6 @@ antora:
|
|
|
7
7
|
const GetLatestRedpandaVersion = require('./getLatestRedpandaVersion');
|
|
8
8
|
const GetLatestConsoleVersion = require('./getLatestConsoleVersion');
|
|
9
9
|
const chalk = require('chalk')
|
|
10
|
-
const _ = require('lodash');
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
module.exports.register = function ({ config }) {
|
|
@@ -32,9 +31,6 @@ module.exports.register = function ({ config }) {
|
|
|
32
31
|
if (component.name !== 'ROOT' && component.name !== 'preview') continue
|
|
33
32
|
|
|
34
33
|
component.versions.forEach(({name, version, asciidoc}) => {
|
|
35
|
-
if (siteCatalog.attributeFile) {
|
|
36
|
-
asciidoc.attributes = _.merge(asciidoc.attributes, siteCatalog.attributeFile);
|
|
37
|
-
}
|
|
38
34
|
if (LatestConsoleVersion) {
|
|
39
35
|
asciidoc.attributes['latest-console-version'] = `${LatestConsoleVersion}`;
|
|
40
36
|
console.log(`${chalk.green('Set Redpanda Console version to')} ${chalk.bold(LatestConsoleVersion)} in ${name} ${version}`);
|