1
0
mirror of synced 2025-12-23 11:54:18 -05:00

remove helper from this branch (to be re-added in child branch for easier reviewing)

This commit is contained in:
Sarah Schneider
2021-01-14 12:07:49 -05:00
parent 79a7a7972f
commit b6032f285c
8 changed files with 9 additions and 30 deletions

View File

@@ -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