Implement lazy loading (#188)

This commit is contained in:
Kromonos 2022-12-18 01:01:07 +01:00 committed by GitHub
parent 17d75c4797
commit f02f1541ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -2,7 +2,7 @@
<div class="post user">
<a href="{{ identity.urls.view }}">
<img src="{{ identity.local_icon_url.relative }}" class="icon" alt="Avatar for {{ identity.name_or_handle }}">
<img src="{{ identity.local_icon_url.relative }}" class="icon" alt="Avatar for {{ identity.name_or_handle }}" loading="lazy">
</a>
{% if created %}

View File

@ -3,7 +3,7 @@
<div class="post {% if reply %}reply{% endif %}" data-takahe-id="{{ post.id }}" role="article" tabindex="0">
<a href="{{ post.author.urls.view }}" tabindex="-1">
<img src="{{ post.author.local_icon_url.relative }}" class="icon">
<img src="{{ post.author.local_icon_url.relative }}" class="icon" loading="lazy">
</a>
<time _="on click go url {% if link_original %}{{ post.url }}{% else %}{{ post.urls.view }}{% endif %} then halt">
@ -79,7 +79,7 @@
{% for attachment in post.attachments.all %}
{% if attachment.is_image %}
<a href="{{ attachment.full_url.relative }}" class="image">
<img src="{{ attachment.thumbnail_url.relative }}" title="{{ attachment.name }}" alt="{{ attachment.name }}" />
<img src="{{ attachment.thumbnail_url.relative }}" title="{{ attachment.name }}" alt="{{ attachment.name }}" loading="lazy" />
</a>
{% endif %}
{% endfor %}

View File

@ -17,7 +17,7 @@
<section class="icon-menu">
{% for identity in page_obj %}
<a class="option" href="{{ identity.urls.view }}">
<img src="{{ identity.local_icon_url.relative }}">
<img src="{{ identity.local_icon_url.relative }}" loading="lazy">
<span class="handle">
{{ identity.html_name_or_handle }}
<small>@{{ identity.handle }}</small>

View File

@ -20,7 +20,7 @@
<section class="icon-menu">
{% for identity in page_obj %}
<a class="option" href="{{ identity.urls.admin_edit }}">
<img src="{{ identity.local_icon_url.relative }}" class="icon" alt="Avatar for {{ identity.name_or_handle }}">
<img src="{{ identity.local_icon_url.relative }}" class="icon" alt="Avatar for {{ identity.name_or_handle }}" loading="lazy">
<span class="handle">
{{ identity.html_name_or_handle }}
<small>