Skip to content

Commit 7c8a769

Browse files
authored
return if no page.latest (#303)
Patches v0.29.0, which introduced a bug that resulted in an Antora FATAL when trying to calcalute the canonical URL value if no `page.latest` value exists for a page.
1 parent 8a6181c commit 7c8a769

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/helpers/neo-canonical-current.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
'use strict'
88

99
module.exports = (page) => {
10+
if (!page.latest) return page.canonicalUrl
1011
const re = new RegExp(`/${page.latest.version}/`)
1112
const latestVersionPath = `/${(page.attributes['latest-version-path'] || 'current')}/`
1213
return page.canonicalUrl.replace(re, latestVersionPath)

0 commit comments

Comments
 (0)