From 5b485bcbd906ac1c389ec1a4566634159b65b180 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Mon, 14 Aug 2023 14:44:21 -0700 Subject: [PATCH] feat: configurable loading strategy --- src/_includes/now.liquid | 10 +++++----- src/_includes/partials/now/media-grid.liquid | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/_includes/now.liquid b/src/_includes/now.liquid index 746ab1fd..d34a09de 100644 --- a/src/_includes/now.liquid +++ b/src/_includes/now.liquid @@ -3,13 +3,13 @@ layout: main --- {% render "partials/header.liquid", site: site, page: page, nav: nav %} {{ content }} -{% render "partials/now/media-grid.liquid", data:artists, icon: "microphone-2", title: "Artists", shape: "square", count: 8 %} -{% render "partials/now/media-grid.liquid", data:albums, icon: "vinyl", title: "Albums", shape: "square", count: 8 %} +{% render "partials/now/media-grid.liquid", data:artists, icon: "microphone-2", title: "Artists", shape: "square", count: 8, loading: 'eager' %} +{% render "partials/now/media-grid.liquid", data:albums, icon: "vinyl", title: "Albums", shape: "square", count: 8, loading: 'lazy' %} {% render "partials/now/albumReleases.liquid", albumReleases:albumReleases %} -{% render "partials/now/media-grid.liquid", data:books, icon: "books", title: "Books", shape: "vertical", count: 6 %} +{% render "partials/now/media-grid.liquid", data:books, icon: "books", title: "Books", shape: "vertical", count: 6, loading: 'lazy' %} {% render "partials/now/links.liquid", links:links %} -{% render "partials/now/media-grid.liquid", data:movies, icon: "movie", title: "Movies", shape: "vertical", count: 6 %} -{% render "partials/now/media-grid.liquid", data:tv, icon: "device-tv", title: "TV", shape: "vertical", count: 6 %} +{% render "partials/now/media-grid.liquid", data:movies, icon: "movie", title: "Movies", shape: "vertical", count: 6, loading: 'lazy' %} +{% render "partials/now/media-grid.liquid", data:tv, icon: "device-tv", title: "TV", shape: "vertical", count: 6, loading: 'lazy' %}

This is a now page, and if you have your own site, you should make one too.

diff --git a/src/_includes/partials/now/media-grid.liquid b/src/_includes/partials/now/media-grid.liquid index 4265e25d..72ef80bb 100644 --- a/src/_includes/partials/now/media-grid.liquid +++ b/src/_includes/partials/now/media-grid.liquid @@ -21,7 +21,7 @@ {% endif %} {%- capture size %}{% if shape == 'square' %}225px{% else %}180px{% endif %}{% endcapture -%} - {% image item.image, alt, 'rounded-lg w-full h-full', size %} + {% image item.image, alt, 'rounded-lg w-full h-full', size, loading %} {% endfor %}