2
0

version-fix.js 833 B

123456789101112131415161718192021222324252627282930
  1. // https://gitlab.com/antora/antora/-/issues/132#note_712132072
  2. 'use strict'
  3. module.exports.register = (pipeline, { config }) => {
  4. pipeline.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. })
  14. })
  15. }
  16. function out(args) {
  17. console.log(JSON.stringify(args, no_data, 2));
  18. }
  19. function no_data(key, value) {
  20. if (key == "data" || key == "files") {
  21. return value ? "__data__" : value;
  22. }
  23. return value;
  24. }