gatsby-simplefolio icon indicating copy to clipboard operation
gatsby-simplefolio copied to clipboard

Images not Working

Open gideongrinberg opened this issue 4 years ago • 6 comments

Hi @cobidev, I want to thank you for building this. I was able to build my portfolio, including images, and it all worked when I used gatsby develop to preview it. However, when I build it and published it to Github Pages via the gatsby build --prefix-paths && gh-pages -d public -b master command (from the docs) the only image that appears is the project.jpg file. I am not familiar with gatsby, so this could be a problem with the images folder, or the png or jpeg extensions, or just my build. The repo is here and the site is gideon357.github.io. Any help is much appreciated 😄 !

Thanks, @gideon357

gideongrinberg avatar Aug 26 '20 20:08 gideongrinberg

@jacobo-martinez any idea how to fix this?

gideongrinberg avatar Aug 31 '20 13:08 gideongrinberg

it's a gatsby issue, see: https://github.com/gatsbyjs/gatsby/issues/20237 it worked for me to run gatsby clean before gatsby deploy :+1:

alexmndzdev avatar Nov 06 '20 23:11 alexmndzdev

Hi- I am also having an issue with the images not working when I view the preview of my portfolio in tthe browser. @Gideon357 did you figure out what the problem was?

I am trying to add an image to the background of the hero image. There is a section in the hero.scss file that says to just uncomment and add your custom image.. I did this but the custom image doesnt show up in the hero section, even though I added it to the images folder. Do I need to import the image somewhere else?

Sorry, I'm kind of a beginner- any help would be appreciated!! thanks!

summer-cook avatar Nov 26 '20 03:11 summer-cook

@summer-cook have you tried with gatsby clean before npm run develop or npm run deploy? I have no experience with the image in hero section but tomorrow i can try and tell you if it works for me

alexmndzdev avatar Nov 26 '20 05:11 alexmndzdev

@summer-cook it seems is a problem with the url('') and the instructions, well to me is not working with that instructions neither; what i did is to put my image in /static (in root directory, create the folder) and to change the line of background to background: url('/image.png'); (see: https://www.gatsbyjs.com/docs/static-folder/). Im gonna do a PR later to fix this :smile:

alexmndzdev avatar Nov 26 '20 21:11 alexmndzdev

thank you so much for your help @alexmndzdev , that worked perfectly :)

summer-cook avatar Nov 29 '20 22:11 summer-cook