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

fix(gatsby-theme-blog): drop path.join to support windows #15370

Merged
merged 7 commits into from Jul 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion themes/gatsby-theme-blog/gatsby-node.js
Expand Up @@ -3,6 +3,7 @@ const path = require(`path`)
const mkdirp = require(`mkdirp`)
const crypto = require(`crypto`)
const Debug = require(`debug`)
const { urlResolve } = require(`gatsby-core-utils`)

const debug = Debug(`gatsby-theme-blog`)

Expand Down Expand Up @@ -168,7 +169,7 @@ exports.onCreateNode = ({ node, actions, getNode, createNodeId }) => {

const toPostPath = node => {
const { dir } = path.parse(node.relativePath)
return path.join(basePath, dir, node.name)
return urlResolve(basePath, dir, node.name)
}

// Make sure it's an MDX node
Expand Down
1 change: 1 addition & 0 deletions themes/gatsby-theme-blog/package.json
Expand Up @@ -23,6 +23,7 @@
"@mdx-js/react": "^1.0.23",
"@theme-ui/prism": "^0.2.8",
"@theme-ui/typography": "^0.2.5",
"gatsby-core-utils": "^1.0.3",
"gatsby-image": "^2.2.5",
"gatsby-plugin-emotion": "^4.1.1",
"gatsby-plugin-feed": "^2.3.3",
Expand Down
3 changes: 2 additions & 1 deletion themes/gatsby-theme-notes/gatsby-node.js
Expand Up @@ -3,6 +3,7 @@ const path = require(`path`)
const mkdirp = require(`mkdirp`)
const crypto = require(`crypto`)
const Debug = require(`debug`)
const { urlResolve } = require(`gatsby-core-utils`)

const debug = Debug(`gatsby-theme-notes`)

Expand Down Expand Up @@ -35,7 +36,7 @@ exports.createPages = async ({ graphql, actions }) => {

const toNotesPath = node => {
const { dir } = path.parse(node.parent.relativePath)
return path.join(basePath, dir, node.parent.name)
return urlResolve(basePath, dir, node.parent.name)
}

const result = await graphql(`
Expand Down
1 change: 1 addition & 0 deletions themes/gatsby-theme-notes/package.json
Expand Up @@ -33,6 +33,7 @@
"@emotion/core": "^10.0.14",
"@mdx-js/mdx": "^1.0.24",
"@mdx-js/react": "^1.0.23",
"gatsby-core-utils": "^1.0.3",
"gatsby-plugin-compile-es6-packages": "^1.1.0",
"gatsby-plugin-emotion": "^4.1.1",
"gatsby-plugin-mdx": "^1.0.11",
Expand Down