Плохо
<div class="snippet_class {% if snippet %}snippet_class--{{ snippet }}{% endif %}}">
<!-- -->
</div>
Хорошо
{% if snippet %}
{% capture snippet_mod %}snippet_class--{{ snippet }}{% endcapture %}
{% endif %}}
<div class="snippet_class {{ snippet_mod }}">
<!-- -->
</div>
Плохо
<script type="text/javascript">
$(function(){
$( '.js-slider--index' ).owlCarousel({
items: 1,
loop: true,
dots: false,
autoplay: {% if settings.index_slider-autoplay == '1' %}true{% else %}false{% endif %},
autoplayTimeout: {% if settings.index_slider-timeout %}{{ settings.index_slider-timeout }}
{% else %}{{ assign timeout = 5000 }}{% endif %},
});
});
</script>
Хорошо
{% if settings.index_slider-autoplay == '1' %}
{% assign is_autoplay = true %}
{% else %}
{% assign is_autoplay = false %}
{% endif %}
{% if settings.index_slider-timeout %}
{% assign timeout = settings.index_slider-timeout %}
{% else %}
{% assign timeout = 5000 %}
{% endif %}
<script type="text/javascript">
$(function(){
$( '.js-slider--index' ).owlCarousel({
items: 1,
loop: true,
dots: false,
autoplay: {{ is_autoplay }},
autoplayTimeout: {{ timeout }}
});
});
</script>