version-fix.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // https://gitlab.com/antora/antora/-/issues/132#note_712132072
  2. 'use strict'
  3. module.exports.register = function({ config }) {
  4. this.on('contentAggregated', ({ contentAggregate }) => {
  5. contentAggregate.forEach(aggregate => {
  6. if (aggregate.name === "" && aggregate.displayVersion === 5.6) {
  7. aggregate.name = "ROOT";
  8. aggregate.version = "5.6.0-RC1"
  9. aggregate.startPage = "ROOT:index.adoc"
  10. aggregate.displayVersion = `${aggregate.version}`
  11. delete aggregate.prerelease
  12. }
  13. if (aggregate.version === "5.6.1" &&
  14. aggregate.prerelease == "-SNAPSHOT") {
  15. aggregate.version = "5.6.1"
  16. aggregate.displayVersion = `${aggregate.version}`
  17. delete aggregate.prerelease
  18. }
  19. })
  20. })
  21. }
  22. function out(args) {
  23. console.log(JSON.stringify(args, no_data, 2));
  24. }
  25. function no_data(key, value) {
  26. if (key == "data" || key == "files") {
  27. return value ? "__data__" : value;
  28. }
  29. return value;
  30. }