-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix path rewrite for pages with paths not ending with '/' #259
Fix path rewrite for pages with paths not ending with '/' #259
Conversation
This seems to solve the problem and take care of the cases I was worried about in #223. Awesome! |
So this seems great. I assume you've setup your server so it'll serve urls lacking trailing slashes correctly? |
@KyleAMathews To be true I haven't done much. Just created extra directory /blog, copied index.html and post's directories there. Then I removed trailing slashes from post's front matter. The only thing that was not working were images. With this PR everything seems to work fine with |
This currently fails. The change in gatsbyjs#259 will make it pass. Currently the image comes out at the wrong path (/hello-worldimage.jpg) ava doesnt have test.failing() yet, and our eslint config prevents the usage of test.todo() so this will most defininitely blow up travis.
This currently fails. The change in #259 will make it pass. Currently the image comes out at the wrong path (/hello-worldimage.jpg) ava doesnt have test.failing() yet, and our eslint config prevents the usage of test.todo() so this will most defininitely blow up travis.
Hiya @jakubrohleder! 👋 This is definitely late, but on behalf of the entire Gatsby community, I wanted to say thank you for being here. Gatsby is built by awesome people like you. Let us say “thanks” in two ways:
If you have questions, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’. Thanks again! 💪💜 |
Today I started playing with this library a little and noticed, that for pages with paths, that does not end with '/' the static files paths are rewritten in the wrong way.
E.g. for page :
Path of
salty_egg.jpg
will be rewritten intopublic/hello-worldsalty_egg.jpg
instead ofpublic/hello-world/salty_egg.jpg
.This simple patch fixes that issue.