Skip to content

Commit

Permalink
fix: replace all spaces with hyphens
Browse files Browse the repository at this point in the history
  • Loading branch information
petertonysmith94 committed Apr 11, 2024
1 parent 48c60ea commit 792126b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs-hub/vp-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function checkOrder(order, altSrcFolderPath = null) {
const itemPath =
item === "Introduction"
? path.join(srcPath, "index.md")
: path.join(srcPath, item.toLowerCase().replace(" ", "-"));
: path.join(srcPath, item.toLowerCase().replaceAll(" ", "-"));

if (
!fs.existsSync(itemPath) &&
Expand All @@ -142,13 +142,13 @@ function checkOrder(order, altSrcFolderPath = null) {
let newPath = path.join(
srcPath,
subFolderExceptions[i],
item.toLowerCase().replace(" ", "-")
item.toLowerCase().replaceAll(" ", "-")
);
if (fs.existsSync(newPath)) {
newItemPath = newPath;
break;
} else {
newPath = path.join(srcPath, subFolderExceptions[i], item.replace(" ", "-"));
newPath = path.join(srcPath, subFolderExceptions[i], item.replaceAll(" ", "-"));
if (fs.existsSync(newPath)) {
newItemPath = newPath;
break;
Expand All @@ -159,7 +159,7 @@ function checkOrder(order, altSrcFolderPath = null) {
fs.existsSync(newItemPath),
`${item
.toLowerCase()
.replace(" ", "-")} doesn't exist at ${itemPath}`
.replaceAll(" ", "-")} doesn't exist at ${itemPath}`
);
}
});
Expand Down Expand Up @@ -187,8 +187,8 @@ function checkOrder(order, altSrcFolderPath = null) {
itemPath = path.join(
srcPath,
subFolderExceptions[i],
key.replace(" ", "-"),
`/${item.replace(" ", "-")}.md`
key.replaceAll(" ", "-"),
`/${item.replaceAll(" ", "-")}.md`
);
if (fs.existsSync(itemPath)) {
fileExists = true;
Expand Down

0 comments on commit 792126b

Please sign in to comment.