I've loaded a CSS file in Assets folder, how do I get the latest version of an url for it?

Hi All,

I’m new here. I added a CSS file (name: style.css.liquid) under the Assets folder in my theme. And I figured out the link for the CSS file is: https://cdn.shopify.com/s/files/…/assets/style.css.liquid , so I included it in my page custom HTML section and it works fine:


However, when I try to edit and update the CSS file in the Assets, I found the link https://cdn.shopify.com/s/files/…/assets/style.css.liquid is to my previous version file, I figured out the link for the updated file should be appended a question mark and a version number: …style.css.liquid?2

Now I want to know how do I always get the latest version of the link? I learnt I should add {{ ‘style.css.liquid’ | asset_url | stylesheet_tag }} before in theme.liquid.

And then I edited the href value but fail:


I don’t know why it fails, could anyone shed some lights on me? any help will be much appreciated!

1 Like

Remove the “.liquid” in theme.liquid as well as the custom HTML section, it should look as follow:

{{ 'style.css' | asset_url | stylesheet_tag }}
1 Like