Skip to content

Commit

Permalink
apply corresponding fix for https://gitlab.com/antora/antora/-/issues…
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Nov 20, 2023
1 parent 75b1951 commit 6e9dd3a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gulp.d/tasks/build-preview-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ function relativize (to, { data: { root } }) {
hash = to.slice(hashIdx)
to = to.slice(0, hashIdx)
}
return to === from
? hash || (to.charAt(to.length - 1) === '/' ? './' : path.basename(to))
: (path.relative(path.dirname(from + '.'), to) || '.') + (to.charAt(to.length - 1) === '/' ? '/' + hash : hash)
if (to === from) return hash || (to.charAt(to.length - 1) === '/' ? './' : path.basename(to))
const rel = path.relative(path.dirname(from + '.'), to)
const toDir = to.charAt(to.length - 1) === '/'
return rel ? (toDir ? rel + '/' : rel) + hash : (toDir ? './' : '../' + path.basename(to)) + hash
}

function resolvePage (spec, context = {}) {
Expand Down

0 comments on commit 6e9dd3a

Please sign in to comment.