Skip to content

Commit 01d8079

Browse files
authored
Merge pull request #31 from Xpirix/optimize_images
Optimize images size and use webp format
2 parents 677b52b + 9fd2914 commit 01d8079

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

django_project/changes/templates/entry/includes/entry_detail.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,22 @@ <h3><span>Feature:</span> {{ entry.title }}</h3>
6363
<img id="{{ entry.image_file.url }}" class="image"
6464
data-gifffer="{{ entry.image_file.url }}"
6565
src="{{ entry.image_file.url }}"
66-
gifffer-alt=""/>
66+
gifffer-alt="" loading="lazy"/>
6767
<a href="#" class="pop-gif">
6868
Click here for bigger size animation.
6969
</a>
7070
{% else %}
7171
<a href="{{ entry.image_file.url }}">
7272
<img class="image"
73-
src="{{ entry.image_file.url }}"
74-
alt=""/>
73+
src="{{ entry.image_file.url }}"
74+
alt="" loading="lazy"/>
7575
</a>
7676
{% endif %}
7777
{% else %}
7878
<a href="#" class="pop-image">
79-
<img id="{{ entry.image_file.url }}" class="image"
80-
src="{{ entry.image_file.url }}"
81-
alt=""/>
79+
{% thumbnail entry.image_file "1000x500" crop="center" format="WEBP" as im %}
80+
<img id="{{ entry.image_file.url }}" class="image is-rounded" src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" alt="Version image" loading="lazy">
81+
{% endthumbnail %}
8282
</a>
8383
{% endif %}
8484
</div>

django_project/changes/templates/layouts/page-title.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div class="is-flex" style="gap: 1rem;">
1010
<div class="label">Free and Open Source</div>
1111
<a class="badge-image" href="https://blog.qgis.org/2025/02/08/qgis-recognized-as-digital-public-good/" target="_blank">
12-
<img src="{% static "images/badges/dpg-badge.png" %}">
12+
<img src="{% static "images/badges/dpg-badge.png" %}" loading="lazy">
1313
</a>
1414
</div>
1515
<h1 class="title hero-title pr-3">
@@ -23,7 +23,7 @@ <h1 class="title hero-title pr-3">
2323
</div>
2424
<div class="logo column is-justify-content-center">
2525
<figure class="image">
26-
<img src="{% static "images/large-logo.svg" %}">
26+
<img src="{% static "images/large-logo.svg" %}" loading="lazy">
2727
</figure>
2828
</div>
2929
</div>

django_project/changes/templates/version/detail-content.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ <h1>
1111
<div class="columns">
1212
<div class="column">
1313
{% if not rst_download %}
14-
<a href="{{ version.image_file.url }}">
15-
<img class="image is-rounded"
16-
src="{{ version.image_file.url }}"/>
14+
<a href="{{ version.image_file.url }}">
15+
{% thumbnail version.image_file "1000x500" crop="center" format="WEBP" as im %}
16+
<img class="image is-rounded" src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" alt="Version image" loading="lazy">
17+
{% endthumbnail %}
1718
</a>
1819
{% else %}
1920
<img class="image is-rounded"

django_project/changes/templates/version/includes/version-list-rich-item.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ <h3 name="titlePreview">
3636

3737
<div class="rich-right" name="imagePreview">
3838
{% thumbnail version.image_file "400x200" crop="center" as im %}
39-
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" alt="Version image" style="border-radius:10px;">
39+
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" alt="Version image" style="border-radius:10px;" loading="lazy">
4040
{% endthumbnail %}
4141
</div>
4242
</div>

0 commit comments

Comments
 (0)