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

Static folder documentation isn't correct #13297

Closed
maxlapides opened this issue Apr 11, 2019 · 1 comment
Closed

Static folder documentation isn't correct #13297

maxlapides opened this issue Apr 11, 2019 · 1 comment
Labels
type: documentation An issue or pull request for improving or updating Gatsby's documentation

Comments

@maxlapides
Copy link
Contributor

Following the instructions on this page https://www.gatsbyjs.org/docs/static-folder/:

  1. I added a file named logo.png to /static
  2. I added pathPrefix: '/img' to gatsby-config.js
  3. I put <img src={withPrefix('/img/logo.png')} alt="Logo" /> in a component

It did not work.

This does work:

  1. I added a file named logo.png to /static
  2. I put <img src='/logo.png' alt="Logo" /> in a component

That worked fine.

I'm probably misunderstanding something here.

@gatsbot gatsbot bot added the type: documentation An issue or pull request for improving or updating Gatsby's documentation label Apr 11, 2019
@marcysutton
Copy link
Contributor

Thanks for reporting! There's a draft PR open for that doc, I can take a look...or if you feel like opening a PR that would be welcome!

marcysutton pushed a commit that referenced this issue Apr 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation An issue or pull request for improving or updating Gatsby's documentation
Projects
None yet
Development

No branches or pull requests

2 participants