1
0
mirror of synced 2025-12-21 02:46:50 -05:00

add remove-fpt helper function

This commit is contained in:
Sarah Schneider
2021-01-14 13:34:32 -05:00
parent 927ead1d5f
commit b511758057
12 changed files with 42 additions and 37 deletions

View File

@@ -3,6 +3,7 @@ const path = require('path')
const patterns = require('./patterns')
const getApplicableVersions = require('./get-applicable-versions')
const allVersions = require('./all-versions')
const removeFPTFromPath = require('./remove-fpt-from-path')
class Permalink {
constructor (languageCode, pageVersion, relativePath, title) {
@@ -13,7 +14,7 @@ class Permalink {
const permalinkSuffix = this.constructor.relativePathToSuffix(relativePath)
this.href = path.join('/', languageCode, pageVersion, permalinkSuffix)
this.href = removeFPTFromPath(path.join('/', languageCode, pageVersion, permalinkSuffix))
.replace(patterns.trailingSlash, '$1')
this.pageVersionTitle = allVersions[pageVersion].versionTitle