Skip to content

Commit

Permalink
add lazy loading, shoutout img tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Charlie Taylor committed Nov 12, 2024
1 parent 063bd04 commit 0c28891
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/gallery.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h3>Posted {{date}}</h3>
{% if pic.winner %}
<li>
<a href="{{pic.click_url}}">
<img src="{{pic.url}}" class="winner" />
<img src="{{pic.url}}" class="winner" loading="lazy" fetchPriority="high" />
</a>
<div class="pic-text">
<span>@{{pic.user}}</span>
Expand All @@ -39,7 +39,7 @@ <h3>Posted {{date}}</h3>
{% else %}
<li>
<a href="{{pic.click_url}}">
<img src="{{pic.url}}" />
<img src="{{pic.url}}" loading="lazy" fetchPriority="{{"high" if loop.index < 5 else "low"}}" />
</a>
<div class="pic-text">
<span>@{{pic.user}}</span>
Expand Down

0 comments on commit 0c28891

Please sign in to comment.