Skip to content

Commit 46e69cc

Browse files
committed
return if no page.latest
1 parent 8a6181c commit 46e69cc

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)