chrisrhymes / bulma-clean-theme

A clean and modern Jekyll theme based on Bulma
http://www.csrhymes.com/bulma-clean-theme/
MIT License
387 stars 492 forks source link

Hero image not loading on Home page #102

Closed vishalgakhare closed 3 years ago

vishalgakhare commented 3 years ago

So, I changed the theme and hero image as follows and deployed:

app.scss =>

$primary: #044592;
// Import Main CSS file from theme
@import "main";

_config.yml =>

defaults:
  -
    scope:
      path: ""
      type: "pages"
    values:
      show_sidebar: true
      hero_image: ../img/hero.png

The hero image is loaded on all the pages but Home. The apparent reason is, the requested URL to the hero image post-publish is: https://github-pages.com/org/repo/img/hero.png ✅ non-Home page. https://github-pages.com/org/img/hero.png 🚫 Home page.

Why would that be so?

1RedOne commented 3 years ago

Try changing the path to

hero_image: /img/hero.png

Using the ../ syntax works for relative paths, but won't work unless the path always resolves. Using / syntax is an absolute link and should resolve no matter where in the heirarchy, as it always relates to the root of the directory.

vishalgakhare commented 3 years ago

@1RedOne Tried both these configurations but result is unchanged.

hero_image: /img/hero.png hero_image: https://github-pages.com/org/repo/img/hero.png

Maybe it's git-hub pages issue.

chrisrhymes commented 3 years ago

I haven't encountered this issue before, maybe check you have set your url: in the _config.yml file?

vishalgakhare commented 3 years ago

I didn't set url in the _config.yml. The github publishing would fail with the url. For the time, I'm not using hero-img and just getting by with the theme.