fix-component-name-display.js 998 B

1234567891011121314151617181920212223
  1. 'use strict'
  2. /**
  3. * The purpose of this extension is to fix invalid metadata saved to either antora.yml or gradle.properties in certain
  4. * tags. This invalid metadata prevents Antora from classifying the component versions properly.
  5. *
  6. * This extension addresses with the following cases:
  7. *
  8. * . the boolean value on the prerelease key is incorrectly quoted
  9. * . the prerelease tag is set to true for a GA version
  10. * . the value of the name key is empty
  11. * . the value of the displayVersion key doesn't match the actual version
  12. * . the -SNAPSHOT suffix is appended to the value of the version key instead of the value of the prerelease key
  13. *
  14. * This extension should be listed directly after @antora/collector-extension.
  15. */
  16. module.exports.register = function () {
  17. this.once('contentAggregated', ({ contentAggregate }) => {
  18. contentAggregate.forEach((componentVersionBucket) => {
  19. Object.assign(componentVersionBucket, { name: 'security', display: 'Spring Security' })
  20. })
  21. })
  22. }