Skip to content

Commit

Permalink
lazy-load images in list views
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Kruse committed Mar 20, 2022
1 parent f359e28 commit 6b4cc36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pictures/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub mod index;
pub mod new;
pub mod show;

static PER_PAGE: i64 = 36;
static PER_PAGE: i64 = 60;

#[derive(Debug, Serialize, Deserialize)]
pub enum ImageTypes {
Expand Down
2 changes: 1 addition & 1 deletion templates/pictures/picture.html.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{% else %}
<a href="{{self::picture_img_uri(picture, None)}}">
{% endif %}
<img src="{{self::picture_img_uri(picture, Some(picture_type))}}" alt="{% if let Some(alt) = picture.alt %}{{alt}}{% endif %}" class="image u-photo">
<img src="{{self::picture_img_uri(picture, Some(picture_type))}}" alt="{% if let Some(alt) = picture.alt %}{{alt}}{% endif %}"{% if index %} loading="lazy"{%endif %} class="image u-photo">
</a>

{% if picture_type != "thumbnail" || home %}
Expand Down

0 comments on commit 6b4cc36

Please sign in to comment.