Asset URL
All the asset files uploaded in the asset folder can be accessed through the asset_url
variable.
For more information, Check Theme File Structure.
Example1:
<link href="{{ asset_url ~ 'style.css' }}" rel="stylesheet" />
<body>
<div class="app">
<img src="{{ asset_url }}image.png" alt="" />
</div>
<script src="{{ asset_url ~ 'main.js' }}"></script>
</body>
{{ asset_url ~ 'style.css' }}
is a way of linking two strings in Twig.
Last modified: 6 months ago