Skip to content

Commit 4b68ef4

Browse files
further optimized loading times via reducing image sizes
1 parent 62a98d2 commit 4b68ef4

File tree

15 files changed

+135
-18
lines changed

15 files changed

+135
-18
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.hugo_build.lock
22
.idea
33
public/
4+
# directory of generated images with reduzed size
5+
resources/_gen/

content/hero/comocamp-smaller.png

-45.5 KB
Binary file not shown.

layouts/page/camp.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ <h2 class="mb-5">{{ .Title }}</h2>
1010

1111
<div class="row">
1212
<div class="col-lg-12 mt-0">
13-
{{ with $.Resources.Get "image-1.jpg" }}
13+
{{ $image := $.Resources.Get "image-1.jpg"}}
14+
{{ $image := $image.Process "resize width 1296x" }}
15+
{{ with $image }}
1416
<img src="{{ .RelPermalink }}" class="img-fluid rounded-4 mb-4" alt="">
1517
{{ end }}
1618
</div>
@@ -30,7 +32,9 @@ <h2 class="mb-5">{{ .Title }}</h2>
3032
{{ end }}
3133
</ul>
3234
<div class="position-relative m-0 mb-lg-3">
33-
{{ with $.Resources.Get "image-2.jpg" }}
35+
{{ $image := $.Resources.Get "image-2.jpg"}}
36+
{{ $image := $image.Process "resize width 628x" }}
37+
{{ with $image }}
3438
<img src="{{ .RelPermalink }}" class="img-fluid rounded-4" alt="">
3539
{{ end }}
3640
</div>
@@ -40,7 +44,9 @@ <h2 class="mb-5">{{ .Title }}</h2>
4044
<div class="content ps-0 ps-lg-4">
4145
<p>{{ $.Params.text2 | markdownify }}</p>
4246
<div class="position-relative mt-4 m-0">
43-
{{ with $.Resources.Get "image-3.jpg" }}
47+
{{ $image := $.Resources.Get "image-3.jpg"}}
48+
{{ $image := $image.Process "resize width 612x" }}
49+
{{ with $image }}
4450
<img src="{{ .RelPermalink }}" class="img-fluid rounded-4" alt="">
4551
{{ end }}
4652
</div>

layouts/page/community.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ <h2>{{ .Title }}</h2>
1515
<div class="testimonial-wrap">
1616
<div class="testimonial-item">
1717
<div class="d-flex align-items-center">
18-
{{ with $.Resources.Get .image }}
18+
{{ $image := $.Resources.Get .image }}
19+
{{ $image := $image.Process "resize width 200x" }}
20+
{{ with $image }}
1921
<img src="{{ .RelPermalink }}" class="testimonial-img flex-shrink-0" alt="">
2022
{{ end }}
2123
<div>

layouts/page/hero.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ <h2>{{ .Params.conference | safeHTML }}</h2>
88
</div>
99
<div class="row gy-5" data-aos="fade-in">
1010
<div class="col-lg-9 order-1 order-lg-2 offset-lg-3 offset-xs-0">
11-
{{ with .Resources.Get "comocamp-smaller.png" }}
11+
{{ $image := .Resources.Get "comocamp.png"}}
12+
{{ $image := $image.Process "resize width 966x" }}
13+
{{ with $image }}
1214
<img src="{{ .RelPermalink }}" class="img-fluid" alt="" data-aos="zoom-out" data-aos-delay="100">
1315
{{ end }}
1416
</div>

layouts/page/location.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ <h2>{{ .Title }}</h2>
1414
<article style="padding: 0px; margin: 0px;">
1515

1616
<div class="post-img">
17-
{{ with $.Resources.Get (printf "%d.png" .) }}
17+
{{ $image := $.Resources.Get (printf "%d.png" .)}}
18+
{{ $image := $image.Process "resize width 416x" }}
19+
{{ with $image }}
1820
<img src="{{ .RelPermalink }}" class="img-fluid" alt="">
1921
{{ end }}
2022
</div>

layouts/page/media-partners.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
<div class="post-img align-items-center" style="vertical-align: middle; text-align: center;">
1313
{{ $link := .link }}
1414
{{ $logo := .logo }}
15-
{{ with $.Resources.Get (print .logo ".png") }}
16-
<a href="{{ $link }}"><img src="{{ .RelPermalink }}" class="mx-auto d-block {{ $logo }}"></a>
15+
{{ $image := $.Resources.Get (print .logo ".png") }}
16+
{{ $image := $image.Process "resize width 400x" }}
17+
{{ with $image }}
18+
<a href="{{ $link }}"><img src="{{ .RelPermalink }}" alt="Logo {{ $link }}" class="mx-auto d-block {{ $logo }}"></a>
1719
{{ end }}
1820
</div>
1921
<p class="post-category centered">{{ .text | markdownify }}</p>

layouts/page/participation.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ <h3 {{ if .soldout }}class="soldout"{{ end }}>{{ .title | safeHTML }}</h3>
2222

2323
<div class="icon {{ if .soldout }}soldout{{ end }}">
2424
<i class="bi bi-{{ .icon }} {{ if .soldout }}soldout{{ end }}"></i>
25-
{{ if .soldout }}<img width="200" height="200" class="soldout-image" src="participation/sold-out.png"></img>{{ end }}
25+
{{ if .soldout }}
26+
{{ $image := $.Resources.Get "sold-out.png" }}
27+
{{ $image := $image.Process "resize width 200x" }}
28+
{{ with $image }}
29+
<img width="200" height="200" class="soldout-image" src="{{ .RelPermalink }}">
30+
{{ end }}
31+
{{ end }}
2632
</div>
2733
{{ if eq .style "hotel" }}<p>Prices start from</p>{{ end }}
2834
<h4 {{ if .soldout }}class="soldout"{{ end }}><sup></sup>{{ .price }}{{ if eq .style "hotel" }}<span> per night</span>{{ end }}</h4>

layouts/page/supporters-2.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ <h2>{{ .Title }}</h2>
2323

2424
<div class="post-img align-items-center" style="vertical-align: middle; text-align: center;">
2525
{{ $link := .link }}
26-
{{ with $.Resources.Get (print .logo ".png") }}
27-
<a href="{{ $link }}" style="text-align: center"><img style="height:100%" src="{{ .RelPermalink }}" class="mx-auto d-block"></a>
26+
{{ $image := $.Resources.Get (print .logo ".png") }}
27+
{{ $image := $image.Process "resize width 400x" }}
28+
{{ with $image }}
29+
<a href="{{ $link }}" style="text-align: center"><img style="height:100%" src="{{ .RelPermalink }}" alt="Logo {{ $link }}" class="mx-auto d-block"></a>
2830
{{ end }}
2931
</div>
3032

layouts/page/supporters.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ <h2>{{ .Title }}</h2>
1919

2020
<div class="post-img align-items-center" style="vertical-align: middle; text-align: center;">
2121
{{ $link := .link }}
22-
{{ with $.Resources.Get (print .logo ".png") }}
23-
<a href="{{ $link }}" style="text-align: center"><img style="height:100%" src="{{ .RelPermalink }}" class="mx-auto d-block"></a>
22+
{{ $image := $.Resources.Get (print .logo ".png") }}
23+
{{ $image := $image.Process "resize width 400x" }}
24+
{{ with $image }}
25+
<a href="{{ $link }}" style="text-align: center"><img style="height:100%" src="{{ .RelPermalink }}" alt="Logo {{ $link }}" class="mx-auto d-block"></a>
2426
{{ end }}
2527
</div>
2628

0 commit comments

Comments
 (0)