Antora 3.0.0

Issue gh-10962
This commit is contained in:
Rob Winch 2022-03-11 12:50:06 -06:00
parent ac9c29b2a0
commit 9967078059
4 changed files with 48 additions and 12 deletions

View File

@ -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

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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