html - Pictures not showing up on Heroku?

后端 未结 9 1785
说谎
说谎 2021-01-15 09:09

I deployed my static HTML website to Heroku using this tutorial (http://www.lemiffe.com/how-to-deploy-a-static-page-to-heroku-the-easy-way/) and my pictures won\'t show up ?

9条回答
  •  长情又很酷
    2021-01-15 09:25

    I had similar problem recently on Windows OS. Pictures loaded properly when tested localy, but on heroku some of the pictures were loading while others where not. And pictures were in the same folder! My paths and script were correct, but as others mentioned it was a case-sensitivity problem. I renamed the files, uploaded again but it didn't help. Why? Because changing the letter case is not recognized as real change for git on windows. To properly load newly named files i did those steps (all commands can be found at heroku tutorial pages):

    1. Destroy heroku app and make a new one
    2. Delete .git folder from your directory
    3. Create new git remote for your app
    4. Push all your files again

    This way, heroku files will have names of files the way you like. Worked for me.

提交回复
热议问题