remove helper from this branch (to be re-added in child branch for easier reviewing)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
const path = require('path')
|
||||
const findPage = require('./find-page')
|
||||
const nonEnterpriseDefaultVersion = require('./non-enterprise-default-version')
|
||||
const removeFPTFromPath = require('./remove-fpt-from-path')
|
||||
|
||||
// rawLinks is an array of paths: [ '/foo' ]
|
||||
// we need to convert it to an array of localized objects: [ { href: '/en/foo', title: 'Foo', intro: 'Description here' } ]
|
||||
@@ -13,7 +12,7 @@ module.exports = async (rawLinks, context, additionalProperties = []) => {
|
||||
for (const link of rawLinks) {
|
||||
const linkPath = link.href || link
|
||||
const version = context.currentVersion === 'homepage' ? nonEnterpriseDefaultVersion : context.currentVersion
|
||||
const href = removeFPTFromPath(path.join('/', context.currentLanguage, version, linkPath))
|
||||
const href = path.join('/', context.currentLanguage, version, linkPath)
|
||||
|
||||
const linkedPage = findPage(href, context.pages, context.redirects)
|
||||
if (!linkedPage) continue
|
||||
|
||||
Reference in New Issue
Block a user