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"> <div class="post user">
<a href="{{ identity.urls.view }}"> <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> </a>
{% if created %} {% if created %}

View File

@ -3,7 +3,7 @@
<div class="post {% if reply %}reply{% endif %}" data-takahe-id="{{ post.id }}" role="article" tabindex="0"> <div class="post {% if reply %}reply{% endif %}" data-takahe-id="{{ post.id }}" role="article" tabindex="0">
<a href="{{ post.author.urls.view }}" tabindex="-1"> <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> </a>
<time _="on click go url {% if link_original %}{{ post.url }}{% else %}{{ post.urls.view }}{% endif %} then halt"> <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 %} {% for attachment in post.attachments.all %}
{% if attachment.is_image %} {% if attachment.is_image %}
<a href="{{ attachment.full_url.relative }}" class="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> </a>
{% endif %} {% endif %}
{% endfor %} {% endfor %}

View File

@ -17,7 +17,7 @@
<section class="icon-menu"> <section class="icon-menu">
{% for identity in page_obj %} {% for identity in page_obj %}
<a class="option" href="{{ identity.urls.view }}"> <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"> <span class="handle">
{{ identity.html_name_or_handle }} {{ identity.html_name_or_handle }}
<small>@{{ identity.handle }}</small> <small>@{{ identity.handle }}</small>

View File

@ -20,7 +20,7 @@
<section class="icon-menu"> <section class="icon-menu">
{% for identity in page_obj %} {% for identity in page_obj %}
<a class="option" href="{{ identity.urls.admin_edit }}"> <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"> <span class="handle">
{{ identity.html_name_or_handle }} {{ identity.html_name_or_handle }}
<small> <small>