mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
Website: Update relative link modification in build-static-content script (#19887)
Closes: #19878 Changes: - Updated the regex that replaced spaces in relative links with dashes to also replace URL encoded space characters.
This commit is contained in:
parent
9d2ec6c57e
commit
00a2e6bac2
1 changed files with 1 additions and 1 deletions
2
website/scripts/build-static-content.js
vendored
2
website/scripts/build-static-content.js
vendored
|
|
@ -281,7 +281,7 @@ module.exports = {
|
|||
throw new Error(`Could not build HTML partials from Markdown. A page (${pageRelSourcePath}) contains an invalid relative Markdown link (${hrefString.replace(/^href=/, '')}). To resolve, make sure all relative links on this page that link to a specific section include the Markdown page extension (.md) and try running this script again.`);
|
||||
}
|
||||
let referencedPageNewUrl = 'https://fleetdm.com/' + (
|
||||
(path.relative(topLvlRepoPath, referencedPageSourcePath).replace(/(^|\/)([^/]+)\.[^/]*$/, '$1$2').split(/\//).map((fileOrFolderName) => fileOrFolderName.toLowerCase().replace(/\s+/g, '-')).join('/'))
|
||||
(path.relative(topLvlRepoPath, referencedPageSourcePath).replace(/(^|\/)([^/]+)\.[^/]*$/, '$1$2').split(/\//).map((fileOrFolderName) => fileOrFolderName.toLowerCase().replace(/%20|\s+/g, '-')).join('/'))
|
||||
.split(/\//).map((fileOrFolderName) => encodeURIComponent(fileOrFolderName.replace(/^[0-9]+[\-]+/,''))).join('/')
|
||||
).replace(RX_README_FILENAME, '');
|
||||
if(possibleReferencedUrlHash) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue