jekyll-assets icon indicating copy to clipboard operation
jekyll-assets copied to clipboard

SASS is not compiled upon image updates

Open antpaw opened this issue 5 years ago • 5 comments

  • [x] I tried updating to the latest version
    • [ ] I can't, there is an issue
    • [ ] This is about an < latest
      • [ ] I understand older versions may be unsupported
  • [ ] I Am on Windows
    • [ ] Ubuntu Bash on Windows
    • [ ] Fedora Bash on Windows
    • [ ] Other Bash on Windows
  • [ ] I Am on Linux
    • [ ] Ubuntu
    • [ ] Fedora
    • [ ] CentOS
    • [ ] Redhat
    • [ ] Debian
  • [ ] I am on macOS 10.13
  • [x] I am on macOS 10.14
  • [ ] I'm on Docker
    • [ ] I understand Docker may be unsupported

Description

SASS is not compiled upon image updates background: asset-url('some-img.png'). you have to make a change in the SASS file to get a compile trigger.

Steps

  • Step 1 save an image to the asset folder
  • Step 2 link that image in the sass with asset-url('some-img.png')
  • Step 3 after the sass is compiled, replace/update the image

Output

no errors here

Expected

nothing happens, but it should update the image in the css and browser.

antpaw avatar Dec 23 '18 11:12 antpaw

This is very much intended behavior. Why should the SASS be recompiled, and updated because an image is updated... they are two independent sources?

envygeeks avatar Dec 24 '18 19:12 envygeeks

@envygeeks right, this should have been a "Feature Request". I've started to report this issue because i get in state where my background image completely disappears after i've updated it, and no matter how often i recompile sass it wont comeback. Only server restart helps. I cant not reliably reproduce this issue, so i ended up writing about the default behavior.

antpaw avatar Dec 27 '18 13:12 antpaw

You should be using Sprockets depend_on to achieve what you want https://github.com/rails/sprockets#depend_on. That's not to say I won't consider doing this on your behalf in the future, but the reality is, we know very little about your assets other than what you tell us, and tell us through Sprockets.

envygeeks avatar Dec 28 '18 15:12 envygeeks

@envygeeks thanks, now i just need this depend_on to accept directories (like link_tree does) or jekyll-assets to add every asset that I link with asset-url to that graph automatically. otherwise its too much manual work.

antpaw avatar Dec 29 '18 09:12 antpaw

We don't link assets, that would be up to Sprockets mostly.

envygeeks avatar Mar 06 '20 05:03 envygeeks