-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
The development server returns HTML instead of static files if you try to load one directly #255
Comments
You can probably take a look how Phenomic handle this use case. We have solved this issue a few weeks ago ;) |
@cutemachine have you tried testing this after building the site? It should work there as by default, Gatsby doesn't catch link clicks in markdown files so the browser will return to the server to grab the file. I just tested this quickly and that worked. But you are correct that this is broken when running |
I have assets like Lua files and zip files, for the user to download. What I want to achieve is to hold the assets within my page structure where the Markdown files and the images are. For the images it works fine, but only for images. I think what I am really looking for is the whitelist for file types. Thanks for the answer. |
Previously it'd return HTML if the accept header had text/html in it which when a browser requests an unknown file, it always does. This caused trouble when someone developing a site would try to click on a link to a static file and instead of the dev server then returning that file, it'd return an html file. Fixes #255
* The dev server now checks if path matches a file Previously it'd return HTML if the accept header had text/html in it which when a browser requests an unknown file, it always does. This caused trouble when someone developing a site would try to click on a link to a static file and instead of the dev server then returning that file, it'd return an html file. Fixes #255 * Fix some things so can run tests against development server
@LukeSheard I was going to wait until this had some tests but... it's a Also the goal is you store assets inside /pages along with other page On Wed, May 4, 2016 at 3:59 PM Luke Sheard notifications@github.com wrote:
|
In my markdown files I link to some zip files a reader can download. But these links do not work, because they get handled by React Router and then result in a 404 error.
What is the best approach to handle file download links with markdown in Gatsby?
The text was updated successfully, but these errors were encountered: