Skip to content

Commit 63f1c7b

Browse files
committed
Fix reference documentation redirects
Closes gh-2044
1 parent e8e4ee2 commit 63f1c7b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

spring-session-docs/antora/extensions/major-minor-segment.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ function createSymbolicVersionAlias (component, version, symbolicVersionSegment,
9191

9292
function computeOut (src, family, version, htmlUrlExtensionStyle) {
9393
let { component, module: module_, basename, extname, relative, stem } = src
94+
if (component === 'ROOT') component = ''
9495
if (module_ === 'ROOT') module_ = ''
9596
let indexifyPathSegment = ''
9697
let familyPathSegment = ''
@@ -120,8 +121,11 @@ function computePub (src, out, family, version, htmlUrlExtensionStyle) {
120121
const pub = {}
121122
let url
122123
if (family === 'nav') {
123-
const urlSegments = version ? [src.component, version] : [src.component]
124-
if (src.module && src.module !== 'ROOT') urlSegments.push(src.module)
124+
const component = src.component || 'ROOT'
125+
const urlSegments = component === 'ROOT' ? [] : [component]
126+
if (version) urlSegments.push(version)
127+
const module_ = src.module || 'ROOT'
128+
if (module_ !== 'ROOT') urlSegments.push(module_)
125129
// an artificial URL used for resolving page references in navigation model
126130
url = '/' + urlSegments.join('/') + '/'
127131
pub.moduleRootPath = '.'

0 commit comments

Comments
 (0)