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

gatsby-theme-blog generate invalid URL for post slug #15507

Closed
malcolm-kee opened this issue Jul 8, 2019 · 4 comments
Closed

gatsby-theme-blog generate invalid URL for post slug #15507

malcolm-kee opened this issue Jul 8, 2019 · 4 comments
Labels
type: bug An issue or pull request relating to a bug in Gatsby

Comments

@malcolm-kee
Copy link
Contributor

Description

The slug for post in gatsby-theme-blog are invalid URL when using windows.

This is due to the code that use path.join to create slug at https://github.com/gatsbyjs/gatsby/blob/master/themes/gatsby-theme-blog/gatsby-node.js#L171, which is fine in unix but problematic in windows because path.join returns backslash in windows.

Steps to reproduce

In windows machine, run:

gatsby new my-blog https://github.com/gatsbyjs/gatsby-starter-blog-theme

Then

npm start

Then you should be able to see the links on the home page is incorrect.

Expected result

The slug for post should be valid URL.

Actual result

image

image

Environment

System:
OS: Windows 10
CPU: (4) x64 Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
Binaries:
Yarn: 1.16.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 44.17763.1.0
npmPackages:
gatsby: ^2.13.6 => 2.13.6
gatsby-theme-blog: ^1.0.0 => 1.0.0

@malcolm-kee
Copy link
Contributor Author

I can work on the fix once someone can confirm this is valid bug (not due to my misunderstanding 😅)

@LekoArts
Copy link
Contributor

LekoArts commented Jul 8, 2019

Ward is working on a fix 👍🏻
#15370

@lannonbr lannonbr added topic: themes type: bug An issue or pull request relating to a bug in Gatsby labels Jul 8, 2019
@johno johno added this to To prioritize in Themes Roadmap Jul 11, 2019
@LekoArts
Copy link
Contributor

Should be fixed now with #15370

Themes Roadmap automation moved this from To prioritize to Done Jul 15, 2019
@bravo-kernel
Copy link

I just created a fresh gatsby-starter-blog-theme on Windows but am having the same problem. Should I do something to pull in the changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug An issue or pull request relating to a bug in Gatsby
Projects
No open projects
Development

No branches or pull requests

4 participants