@redpanda-data/docs-extensions-and-macros 3.0.14 → 3.0.15
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.
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
module.exports.register = function ({ config }) {
|
|
8
8
|
const yaml = require('js-yaml');
|
|
9
|
-
const _ = require('lodash');
|
|
10
9
|
const logger = this.getLogger('global-attributes-extension');
|
|
11
10
|
const chalk = require('chalk')
|
|
12
11
|
|
|
@@ -29,18 +28,4 @@ module.exports.register = function ({ config }) {
|
|
|
29
28
|
logger.error(`Error loading attributes: ${error.message}`);
|
|
30
29
|
}
|
|
31
30
|
})
|
|
32
|
-
|
|
33
|
-
.on('contentClassified', ({ siteCatalog, contentCatalog }) => {
|
|
34
|
-
const components = contentCatalog.getComponents()
|
|
35
|
-
try {
|
|
36
|
-
components.forEach(({versions}) => {
|
|
37
|
-
versions.forEach(({asciidoc}) => {
|
|
38
|
-
asciidoc.attributes = _.merge(asciidoc.attributes, siteCatalog.attributeFile);
|
|
39
|
-
})
|
|
40
|
-
});
|
|
41
|
-
console.log(chalk.green('Merged global attributes into each component version.'));
|
|
42
|
-
} catch (error) {
|
|
43
|
-
logger.error(`Error merging attributes: ${error.message}`);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
31
|
}
|
|
@@ -7,6 +7,7 @@ antora:
|
|
|
7
7
|
const GetLatestRedpandaVersion = require('./getLatestRedpandaVersion');
|
|
8
8
|
const GetLatestConsoleVersion = require('./getLatestConsoleVersion');
|
|
9
9
|
const chalk = require('chalk')
|
|
10
|
+
const _ = require('lodash');
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
module.exports.register = function ({ config }) {
|
|
@@ -15,7 +16,7 @@ module.exports.register = function ({ config }) {
|
|
|
15
16
|
logger.warn('REDPANDA_GITHUB_TOKEN environment variable not set. Attempting unauthenticated request.');
|
|
16
17
|
}
|
|
17
18
|
this
|
|
18
|
-
.on('contentClassified', async ({ contentCatalog }) => {
|
|
19
|
+
.on('contentClassified', async ({ siteCatalog,contentCatalog }) => {
|
|
19
20
|
try {
|
|
20
21
|
const LatestRedpandaVersion = await GetLatestRedpandaVersion();
|
|
21
22
|
const LatestConsoleVersion = await GetLatestConsoleVersion();
|
|
@@ -30,6 +31,16 @@ module.exports.register = function ({ config }) {
|
|
|
30
31
|
let component = components[i];
|
|
31
32
|
if (component.name !== 'ROOT' && component.name !== 'preview') continue
|
|
32
33
|
|
|
34
|
+
component.versions.forEach(({name, version, asciidoc}) => {
|
|
35
|
+
if (siteCatalog.attributeFile) {
|
|
36
|
+
asciidoc.attributes = _.merge(asciidoc.attributes, siteCatalog.attributeFile);
|
|
37
|
+
}
|
|
38
|
+
if (LatestConsoleVersion) {
|
|
39
|
+
asciidoc.attributes['latest-console-version'] = `${LatestConsoleVersion}`;
|
|
40
|
+
console.log(`${chalk.green('Set Redpanda Console version to')} ${chalk.bold(LatestConsoleVersion)} in ${name} ${version}`);
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
|
|
33
44
|
if (!component.latest.asciidoc) {
|
|
34
45
|
component.latest.asciidoc = {};
|
|
35
46
|
}
|
|
@@ -42,14 +53,7 @@ module.exports.register = function ({ config }) {
|
|
|
42
53
|
|
|
43
54
|
component.latest.asciidoc.attributes['full-version'] = `${LatestRedpandaVersion[0]}`;
|
|
44
55
|
component.latest.asciidoc.attributes['latest-release-commit'] = `${LatestRedpandaVersion[1]}`;
|
|
45
|
-
console.log(`${chalk.green('Set Redpanda version to')} ${chalk.bold(LatestRedpandaVersion[0])} ${chalk.bold(LatestRedpandaVersion[1])}`)
|
|
46
|
-
|
|
47
|
-
if (LatestConsoleVersion) {
|
|
48
|
-
for (const { asciidoc } of component.versions) {
|
|
49
|
-
asciidoc.attributes['latest-console-version'] = `${LatestConsoleVersion}`;
|
|
50
|
-
}
|
|
51
|
-
console.log(`${chalk.green('Set Redpanda Console version to')} ${chalk.bold(LatestConsoleVersion)}`);
|
|
52
|
-
}
|
|
56
|
+
console.log(`${chalk.green('Set the latest Redpanda version to')} ${chalk.bold(LatestRedpandaVersion[0])} ${chalk.bold(LatestRedpandaVersion[1])}`)
|
|
53
57
|
}
|
|
54
58
|
} catch(error) {
|
|
55
59
|
logger.warn(error)
|