chore: configurable loading

This commit is contained in:
Cory Dransfeldt 2023-10-27 13:45:19 -07:00
parent 4108ce86ef
commit a05666f1c7
4 changed files with 12 additions and 4 deletions

View file

@ -3,7 +3,7 @@ layout: main
---
{% render "partials/header.liquid", site: site, page: page, nav: nav %}
{{ content }}
{% render "partials/now/media-grid.liquid", data:music.artists, icon: "microphone-2", title: "Artists", shape: "square", count: 8 %}
{% render "partials/now/media-grid.liquid", data:music.artists, icon: "microphone-2", title: "Artists", shape: "square", count: 8, loading: 'eager' %}
{% render "partials/now/media-grid.liquid", data:music.albums, icon: "vinyl", title: "Albums", shape: "square", count: 8 %}
{% render "partials/now/albumReleases.liquid", albumReleases:albumReleases %}
{% render "partials/now/media-grid.liquid", data:books, icon: "books", title: "Books", shape: "vertical", count: 6 %}

View file

@ -20,7 +20,14 @@
</div>
{% endif %}
</div>
{% image item.image, alt, 'rounded-lg w-full h-full [&>*]:h-full' %}
{%- capture loadingStrategy %}
{% if loading %}
{{ loading }}
{% else %}
'lazy'
{% endif %}
{% endcapture -%}
{% image item.image, alt, 'rounded-lg w-full h-full [&>*]:h-full', loadingStrategy %}
</div>
</a>
{% endfor %}