Static files - Where should I place images and fonts? #43
-
Where should I place static files like images and fonts? And how do I make sure that images used in liquid templates get placed in the Also, placing fonts in By the way, great project, super handy. Thanks for making it. :-) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
My current workaround is adding this to
|
Beta Was this translation helpful? Give feedback.
-
Hi Jon 👋. You should place the images inside To include them in a <img src="{{ 'file-name.static.png' | asset_url }}">
<!-- or -->
<img src="{{ 'file-name.static.png' | asset_img_url: '300x' }}"> |
Beta Was this translation helpful? Give feedback.
Hi Jon 👋.
You should place the images inside
shopify/assets/
directory. There is no need to process them through webpack. Add thestatic
keyword to their file name e.g.file-name.static.png
. That way they won't be cleaned by webpack during builds and git will track them.To include them in a
.liquid
file use: