mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-05-31 01:02:14 +00:00
Update to Antora 3.0.0
This commit is contained in:
parent
d5483f7cbb
commit
96e5e67737
@ -21,8 +21,7 @@ ui:
|
|||||||
url: https://github.com/spring-io/antora-ui-spring/releases/download/latest/ui-bundle.zip
|
url: https://github.com/spring-io/antora-ui-spring/releases/download/latest/ui-bundle.zip
|
||||||
snapshot: true
|
snapshot: true
|
||||||
|
|
||||||
pipeline:
|
antora:
|
||||||
extensions:
|
extensions:
|
||||||
- require: ./antora/extensions/version-fix.js
|
- require: ./antora/extensions/version-fix.js
|
||||||
- require: ./antora/extensions/major-minor-segment.js
|
- require: ./antora/extensions/major-minor-segment.js
|
||||||
- require: ./antora/extensions/root-component-name.js
|
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
const { posix: path } = require('path')
|
const { posix: path } = require('path')
|
||||||
|
|
||||||
module.exports.register = (pipeline, { config }) => {
|
module.exports.register = function({ config }) {
|
||||||
pipeline.on('contentClassified', ({ contentCatalog }) => {
|
this.on('contentClassified', ({ contentCatalog }) => {
|
||||||
contentCatalog.getComponents().forEach(component => {
|
contentCatalog.getComponents().forEach(component => {
|
||||||
const componentName = component.name;
|
const componentName = component.name;
|
||||||
const generationToVersion = new Map();
|
const generationToVersion = new Map();
|
||||||
@ -197,4 +197,4 @@ function no_data(key, value) {
|
|||||||
return value ? "__data__" : value;
|
return value ? "__data__" : value;
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
@ -1,40 +0,0 @@
|
|||||||
// https://gitlab.com/antora/antora/-/issues/132#note_712132072
|
|
||||||
'use strict'
|
|
||||||
|
|
||||||
const { posix: path } = require('path')
|
|
||||||
|
|
||||||
module.exports.register = (pipeline, { config }) => {
|
|
||||||
pipeline.on('contentClassified', ({ contentCatalog }) => {
|
|
||||||
const rootComponentName = config.rootComponentName || 'ROOT'
|
|
||||||
const rootComponentNameLength = rootComponentName.length
|
|
||||||
contentCatalog.findBy({ component: rootComponentName }).forEach((file) => {
|
|
||||||
if (file.out) {
|
|
||||||
file.out.dirname = file.out.dirname.substr(rootComponentNameLength)
|
|
||||||
file.out.path = file.out.path.substr(rootComponentNameLength + 1)
|
|
||||||
file.out.rootPath = fixPath(file.out.rootPath)
|
|
||||||
}
|
|
||||||
if (file.pub) {
|
|
||||||
file.pub.url = file.pub.url.substr(rootComponentNameLength + 1)
|
|
||||||
if (file.pub.rootPath) {
|
|
||||||
file.pub.rootPath = fixPath(file.pub.rootPath)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (file.rel) {
|
|
||||||
if (file.rel.pub) {
|
|
||||||
file.rel.pub.url = file.rel.pub.url.substr(rootComponentNameLength + 1)
|
|
||||||
file.rel.pub.rootPath = fixPath(file.rel.pub.rootPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
const rootComponent = contentCatalog.getComponent(rootComponentName)
|
|
||||||
rootComponent?.versions?.forEach((version) => {
|
|
||||||
version.url = version.url.substr(rootComponentName.length + 1)
|
|
||||||
})
|
|
||||||
// const siteStartPage = contentCatalog.getById({ component: '', version: '', module: '', family: 'alias', relative: 'index.adoc' })
|
|
||||||
// if (siteStartPage) delete siteStartPage.out
|
|
||||||
})
|
|
||||||
|
|
||||||
function fixPath(path) {
|
|
||||||
return path.split('/').slice(1).join('/') || '.'
|
|
||||||
}
|
|
||||||
}
|
|
@ -2,9 +2,8 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
|
|
||||||
module.exports.register = (pipeline, { config }) => {
|
module.exports.register = function({ config }) {
|
||||||
|
this.on('contentAggregated', ({ contentAggregate }) => {
|
||||||
pipeline.on('contentAggregated', ({ contentAggregate }) => {
|
|
||||||
contentAggregate.forEach(aggregate => {
|
contentAggregate.forEach(aggregate => {
|
||||||
if (aggregate.name === "" && aggregate.displayVersion === 5.6) {
|
if (aggregate.name === "" && aggregate.displayVersion === 5.6) {
|
||||||
aggregate.name = "ROOT";
|
aggregate.name = "ROOT";
|
||||||
|
@ -7,7 +7,7 @@ apply plugin: 'io.spring.convention.docs'
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
|
|
||||||
antora {
|
antora {
|
||||||
antoraVersion = "3.0.0-alpha.8"
|
antoraVersion = "3.0.0"
|
||||||
arguments = ["--fetch", "--stacktrace"]
|
arguments = ["--fetch", "--stacktrace"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user