-
Notifications
You must be signed in to change notification settings - Fork 364
Do you have to run yarn deploy to use {{ img.jpg | asset_url }} in a liquid file? #658
Comments
Have you trying referencing this asset using |
When I use
and when I use |
I'm having the same problem in both my theme and header section files. |
WAIT! I just read your comment more carefully. I didn't at first notice the difference between the two lines of code you used. I made the same switch between |
The reference on how to set up the quotes I found on the Slate Themes Wiki page about the static directory. Which I am doing, but the static files aren't local they are sourcing the files on Shopify. @timtorres when you use this do you get a local image or the one on Shopify? My understanding is that it should be local so you don't have to deploy the theme everytime you add an image to the static directory. But that isn't currently happening to me. |
for me images are only uploaded when I deploy and when the images are in the static folder (no other folder works) |
Ok, I got this to work. After playing around with single and double quotes.
Now compiles to the correct local file...
And most importantly points to the correct file on Shopify when deployed.
Hope this help others understand. |
Ok, this works in html, but not in scss. Liquid in HTML
compiles to...
But as Liquid in theme.scss.liquid it compiles this
into...
or...
into
I guess the main problem is that files in the static folder are not automatically uploaded to Shopify so the images are shown as missing. And/or Slate isn't changing the url parameter in the scss to look at the local address instead of the Shopify address. Let me know if I am missing something. |
@yankeyhotel When I used what I wrote above, it only pointed to Shopify's CDN. My understanding and results are the same as yours and @eighthday . What I did was just manually upload my image and css files to the assets folder using the online theme editor and that worked, however that's proving to be a problem with active development. When I use |
I'm kinda bummed by these inefficiencies, Slate seems like it could bring a lot to the table, but misses so hard on basic development. I've been using ThemeKit for a long time, and to be honest, its workflow is so much easier and quicker. Probably going to go back to it. |
Hey @yankeyhotel -- thanks for posting your progress here, it really helps others with the same problem. Please keep in mind that Slate v1 is still in beta so it should be expected to hit some of these kinds of problems. Would you mind opening a separate issue about using images in SCSS? |
Assets have been simplified in #850 and the change is now available in v1.0.0-beta.12. Docs that have also been updated: https://github.com/Shopify/slate/wiki/Slate-themes |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Problem
I have added images to
src/static
, but they don't show up in the browser until I runyarn deploy
. Is there a way to make the images upload to Shopify automatically?I guess it would work on just restarting via
yarn start
. Is that the best way?Thanks
The text was updated successfully, but these errors were encountered: