diff --git a/docs/antora-playbook.yml b/docs/antora-playbook.yml index c584e63f6f..cb7dc04b4b 100644 --- a/docs/antora-playbook.yml +++ b/docs/antora-playbook.yml @@ -10,6 +10,7 @@ content: branches: [spring-projects/spring-security/*] - url: https://github.com/spring-projects/spring-security branches: [main,5.6.x,5.7.x] + tags: ['5.6.*','!5.6.0-M*','5.7.*','6.0.*'] start_path: docs urls: latest_version_segment_strategy: redirect:to @@ -20,7 +21,7 @@ ui: url: https://github.com/spring-io/antora-ui-spring/releases/download/latest/ui-bundle.zip snapshot: true -pipeline: +antora: extensions: + - require: ./antora/extensions/version-fix.js - require: ./antora/extensions/major-minor-segment.js - - require: ./antora/extensions/root-component-name.js diff --git a/docs/antora/extensions/major-minor-segment.js b/docs/antora/extensions/major-minor-segment.js index eec0764544..3c3761f923 100644 --- a/docs/antora/extensions/major-minor-segment.js +++ b/docs/antora/extensions/major-minor-segment.js @@ -3,8 +3,8 @@ const { posix: path } = require('path') -module.exports.register = (pipeline, { config }) => { - pipeline.on('contentClassified', ({ contentCatalog }) => { +module.exports.register = function({ config }) { + this.on('contentClassified', ({ contentCatalog }) => { contentCatalog.getComponents().forEach(component => { const componentName = component.name; const generationToVersion = new Map(); @@ -197,4 +197,4 @@ function no_data(key, value) { return value ? "__data__" : value; } return value; -} \ No newline at end of file +} diff --git a/docs/antora/extensions/version-fix.js b/docs/antora/extensions/version-fix.js new file mode 100644 index 0000000000..b0208d25d7 --- /dev/null +++ b/docs/antora/extensions/version-fix.js @@ -0,0 +1,35 @@ +// https://gitlab.com/antora/antora/-/issues/132#note_712132072 +'use strict' + + +module.exports.register = function({ config }) { + this.on('contentAggregated', ({ contentAggregate }) => { + contentAggregate.forEach(aggregate => { + if (aggregate.name === "" && aggregate.displayVersion === 5.6) { + aggregate.name = "ROOT"; + aggregate.version = "5.6.0-RC1" + aggregate.startPage = "ROOT:index.adoc" + aggregate.displayVersion = `${aggregate.version}` + delete aggregate.prerelease + } + if (aggregate.version === "5.6.1" && + aggregate.prerelease == "-SNAPSHOT") { + aggregate.version = "5.6.1" + aggregate.displayVersion = `${aggregate.version}` + delete aggregate.prerelease + } + }) + }) +} + +function out(args) { + console.log(JSON.stringify(args, no_data, 2)); +} + + +function no_data(key, value) { + if (key == "data" || key == "files") { + return value ? "__data__" : value; + } + return value; +} diff --git a/docs/local-antora-playbook.yml b/docs/local-antora-playbook.yml index 724e43819e..bf3f11ad85 100644 --- a/docs/local-antora-playbook.yml +++ b/docs/local-antora-playbook.yml @@ -6,10 +6,10 @@ asciidoc: page-pagination: true content: sources: - - url: ../../spring-io/spring-generated-docs - branches: [spring-projects/spring-security/*] - - url: ../../spring-projects/spring-security - branches: [main,5.6.x,5.7.x] + - url: https://github.com/spring-io/spring-generated-docs + branches: [spring-projects/spring-security/5.7.x] + - url: ../ + branches: HEAD start_path: docs urls: latest_version_segment_strategy: redirect:to @@ -20,7 +20,7 @@ ui: url: https://github.com/spring-io/antora-ui-spring/releases/download/latest/ui-bundle.zip snapshot: true -pipeline: +antora: extensions: - - require: ./antora/extensions/major-minor-segment.js - - require: ./antora/extensions/root-component-name.js + - require: ./antora/extensions/version-fix.js + - require: ./antora/extensions/major-minor-segment.js \ No newline at end of file