Performance

Defer Non-Critical Scripts

Loads JavaScript after HTML parsing when possible.

Copy or embed this snippet

<script src="{{ 'theme.js' | asset_url }}" defer></script>
{% if template.name == 'product' %}
  <script src="{{ 'product-form.js' | asset_url }}" defer></script>
{% endif %}

Embed this snippet on your blog or docs — attribution link appreciated: HTML to Liquid Converter · Convert to Shopify section →

Practice in the converter workspace

Draft OS 2.0 section output after you choose the right design pattern.