Skip to content

Commit

Permalink
Fix {{ root }} variable having Windows path separators, closes founda…
Browse files Browse the repository at this point in the history
  • Loading branch information
gakimball committed Mar 8, 2017
1 parent a3e64b8 commit bc11431
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/processRoot.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var path = require('path');
var slash = require('slash');

/**
* Creates a string that can be prepended to a file path that needs to resolve to the root.
Expand All @@ -16,7 +17,7 @@ module.exports = function(page, root) {
relativePath += '/';
}

// On Windows, Node uses a "\" for the separator
// On Windows, paths are separated with a "\"
// However, web browsers use "/" no matter the platform
return relativePath.replace('\\', '/');
return slash(relativePath);
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"js-yaml": "^3.5.2",
"marked": "^0.3.6",
"nopt": "^4.0.1",
"slash": "^1.0.0",
"through2": "^2.0.0",
"vinyl-fs": "^2.4.4"
},
Expand Down

0 comments on commit bc11431

Please sign in to comment.