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

Why pathPrefix does not work for gifs in pages's md after deploy #4148

Closed
FengShangWuQi opened this issue Feb 20, 2018 · 7 comments
Closed

Comments

@FengShangWuQi
Copy link
Contributor

FengShangWuQi commented Feb 20, 2018

I add a pathPrefix with project name instead of /, but I found that can not find gif files correctly after deploy using github pages, it returns 404, however, pictures in pages's md returns 200.

network looks like this:
png: ...github.io/pathPrefix/static/path/xx.png -> 200
gif: ...github.io/xx.gif -> 404

@KyleAMathews
Copy link
Contributor

Hmmm looks like https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-remark-copy-linked-files/src/index.js needs updated to support path prefixes. Is this something you'd be interested in fixing? Would love to help you make a PR!

@FengShangWuQi
Copy link
Contributor Author

Thanks a lot 👍, waiting for your good news, and I also find that the files in static/ in the same problem after add pathPrefix.

@FengShangWuQi
Copy link
Contributor Author

@KyleAMathews Is this problem solved?

@KyleAMathews
Copy link
Contributor

@FengShangWuQi no one has written a PR for it so no. Would love it if you wanted to look into solving the issue! See our contributing guide https://www.gatsbyjs.org/docs/how-to-contribute/

@ajrussellaudio
Copy link

I've also hit this issue. Can I suggest that this issue is given a more descriptive name to reflect that is doesn't only affect GIF images, but all files with relative links inside Markdown after a deploy with pathPrefix.

I'm going to have a crack at a PR to fix this, but it's my first time digging into the Gatsby internals so I won't have instant results.

@ajrussellaudio
Copy link

...actually this has been fixed. If anyone is still searching for this , update your package.json to require a newer version of gatsby-remark-copy-linked-files, version 1.5.31 worked for me.

{
  "dependencies": {
    "gatsby-remark-copy-linked-files": "^1.5.31",
  }
}

@pieh
Copy link
Contributor

pieh commented Apr 13, 2018

as @ajrussellaudio mentioned - this was fixed with #4841

@pieh pieh closed this as completed Apr 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants