Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows slashes #140

Merged
merged 2 commits into from
Feb 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/utils/glob-pages.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import glob from 'glob'
import path from 'path'
import parsePath from 'parse-filepath'
import slash from 'slash'
import fs from 'fs'
import frontMatter from 'front-matter'
import htmlFrontMatter from 'html-frontmatter'
Expand Down Expand Up @@ -29,7 +30,10 @@ module.exports = (directory, callback) => {
pageData.file.ext = ext = parsed.extname.slice(1)

// Determine require path
pageData.requirePath = path.relative(`${directory}/pages`, page)
pageData.requirePath = slash(path.relative(`${directory}/pages`, page))

// Make sure slashes on parsed.dirname are correct for Windows
parsed.dirname = slash(parsed.dirname)

// Load data for each file type.
let data
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"react-transform-hmr": "^1.0.0",
"redbox-react": "^1.0.1",
"sass-loader": "^3.1.2",
"slash": "^1.0.0",
"static-site-generator-webpack-plugin": "^2.0.1",
"style-loader": "^0.13.0",
"toml": "^2.2.2",
Expand Down