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

Reduce usage of linkPrefix in 1.x #475

Closed
KyleAMathews opened this issue Sep 26, 2016 · 1 comment
Closed

Reduce usage of linkPrefix in 1.x #475

KyleAMathews opened this issue Sep 26, 2016 · 1 comment
Labels
help wanted Issue with a clear description that the community can help with. stale? Issue that may be closed soon due to the original author not responding any more.
Milestone

Comments

@KyleAMathews
Copy link
Contributor

KyleAMathews commented Sep 26, 2016

A common problem with building sites is that you may deploy the same site in dev/testing/prod with different URL roots. Often it's just / but perhaps you're deploying to Github pages at YOUR_NAME.github.io/PROJECT_NAME in which case you'd need to prefix all links with /PROJECT_NAME.

In 0.x we just run everything through a helper function linkPrefix in the included module gatsby-helpers. This works but it's a bit annoying to have to surround every link on your site with this special function. Especially when Webpack + React Router can do the heavy lifting for us with publicPath in Webpack and basename in React Router.

I've already fixed this in Webpack in the 1.0 branch but adding basename support to react-router still needs to happen.

@KyleAMathews KyleAMathews added the help wanted Issue with a clear description that the community can help with. label Sep 26, 2016
@KyleAMathews KyleAMathews added this to the 1.0 milestone Sep 26, 2016
@jbolda jbolda added the stale? Issue that may be closed soon due to the original author not responding any more. label Jun 5, 2017
@KyleAMathews
Copy link
Contributor Author

Fixed now in v1. No more need to use prefixLink!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issue with a clear description that the community can help with. stale? Issue that may be closed soon due to the original author not responding any more.
Projects
None yet
Development

No branches or pull requests

2 participants