Use Antora name of security

Issue gh-13327
This commit is contained in:
Rob Winch 2023-06-16 21:58:41 -05:00
parent 17444d56a8
commit a69cd7d5d9
2 changed files with 26 additions and 0 deletions

View File

@ -6,6 +6,7 @@ antora:
- require: '@springio/antora-extensions/latest-version-extension'
- require: '@springio/antora-extensions/inject-collector-cache-config-extension'
- '@antora/collector-extension'
- ./lib/antora/extensions/fix-component-name-display.js
- '@antora/atlas-extension'
- require: '@springio/antora-extensions/tabs-migration-extension'
# uncomment this option to save the migrated content to the worktree
@ -14,6 +15,8 @@ antora:
- require: '@springio/antora-extensions/publish-docsearch-config-extension'
index_name: 'spring-security-docs'
root_component_name: 'security'
- require: '@springio/antora-extensions/root-component-extension'
root_component_name: 'security'
site:
title: Spring Security
url: https://docs.spring.io/spring-security/reference

View File

@ -0,0 +1,23 @@
'use strict'
/**
* The purpose of this extension is to fix invalid metadata saved to either antora.yml or gradle.properties in certain
* tags. This invalid metadata prevents Antora from classifying the component versions properly.
*
* This extension addresses with the following cases:
*
* . the boolean value on the prerelease key is incorrectly quoted
* . the prerelease tag is set to true for a GA version
* . the value of the name key is empty
* . the value of the displayVersion key doesn't match the actual version
* . the -SNAPSHOT suffix is appended to the value of the version key instead of the value of the prerelease key
*
* This extension should be listed directly after @antora/collector-extension.
*/
module.exports.register = function () {
this.once('contentAggregated', ({ contentAggregate }) => {
contentAggregate.forEach((componentVersionBucket) => {
Object.assign(componentVersionBucket, { name: 'security', display: 'Spring Security' })
})
})
}