Skip to content

Commit c3bf1db

Browse files
committed
Support WEBP versions of single images and use this for avatars
These photos of individuals are fairly large files for what they are, so making the available in WEBP should save visitors some download size. Created with the same script introduced previously.
1 parent 8df7526 commit c3bf1db

9 files changed

Lines changed: 40 additions & 18 deletions

_includes/picture-with-webp.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<picture>
2+
<source srcset="{{ site.baseurl }}{{ include.image }}.webp" type="image/webp" />
3+
<img class="{{ include.class }}" src="{{ site.baseurl }}{{ include.image }}" alt="{{ include.alt }}" />
4+
</picture>

governance.html

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,12 @@ <h3>Diane Dowling</h3>
4545
</p>
4646
</div>
4747
<div class="column m-3-12 horizontally-centered-column">
48-
<img class="trustee-avatar"
49-
src="{{ '/images/advertising/headshots/trustee-diane-01.jpg' | prepend: site.baseurl }}"
50-
alt="Headshot of Diane" />
48+
{%
49+
include picture-with-webp.html
50+
class="trustee-avatar"
51+
image="/images/advertising/headshots/trustee-diane-01.jpg"
52+
alt="Headshot of Diane"
53+
%}
5154
</div>
5255
</div>
5356
<div class="row vertically-centered-row trustee-row">
@@ -60,9 +63,12 @@ <h3>David Massey</h3>
6063
</p>
6164
</div>
6265
<div class="column m-3-12 horizontally-centered-column">
63-
<img class="trustee-avatar"
64-
src="{{ '/images/advertising/headshots/trustee-david-01.jpg' | prepend: site.baseurl }}"
65-
alt="Headshot of David" />
66+
{%
67+
include picture-with-webp.html
68+
class="trustee-avatar"
69+
image="/images/advertising/headshots/trustee-david-01.jpg"
70+
alt="Headshot of David"
71+
%}
6672
</div>
6773
</div>
6874
<div class="row vertically-centered-row trustee-row">
@@ -74,9 +80,12 @@ <h3>Thomas "Scarzy" Scarsbrook</h3>
7480
</p>
7581
</div>
7682
<div class="column m-3-12 horizontally-centered-column">
77-
<img class="trustee-avatar"
78-
src="{{ '/images/advertising/headshots/trustee-scarzy-01.jpg' | prepend: site.baseurl }}"
79-
alt="Headshot of Thomas" />
83+
{%
84+
include picture-with-webp.html
85+
class="trustee-avatar"
86+
image="/images/advertising/headshots/trustee-scarzy-01.jpg"
87+
alt="Headshot of Thomas"
88+
%}
8089
</div>
8190
</div>
8291
</div>
31.8 KB
Loading
32.1 KB
Loading
44.1 KB
Loading
153 KB
Loading
197 KB
Loading
184 KB
Loading

index.html

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,12 @@ <h2 class="text-center">Testimonials</h2>
127127
</p>
128128
</div>
129129
<div class="column m-3-12 horizontally-centered-column">
130-
<img class="testimonial-avatar"
131-
src="{{ '/images/advertising/headshots/competitor-phil-01.jpg' | prepend: site.baseurl }}"
132-
alt="Headshot of Phil" />
130+
{%
131+
include picture-with-webp.html
132+
class="testimonial-avatar"
133+
image="/images/advertising/headshots/competitor-phil-01.jpg"
134+
alt="Headshot of Phil"
135+
%}
133136
</div>
134137
</div>
135138
<div class="row vertically-centered-row top-spacing testimonial-row">
@@ -146,9 +149,12 @@ <h2 class="text-center">Testimonials</h2>
146149
</p>
147150
</div>
148151
<div class="column m-3-12 horizontally-centered-column">
149-
<img class="testimonial-avatar"
150-
src="{{ '/images/advertising/headshots/competitor-becky-01.jpg' | prepend: site.baseurl }}"
151-
alt="Headshot of Becky" />
152+
{%
153+
include picture-with-webp.html
154+
class="testimonial-avatar"
155+
image="/images/advertising/headshots/competitor-becky-01.jpg"
156+
alt="Headshot of Becky"
157+
%}
152158
</div>
153159
</div>
154160
<div class="row vertically-centered-row top-spacing testimonial-row">
@@ -167,9 +173,12 @@ <h2 class="text-center">Testimonials</h2>
167173
</p>
168174
</div>
169175
<div class="column m-3-12 horizontally-centered-column">
170-
<img class="testimonial-avatar"
171-
src="{{ '/images/advertising/headshots/competitor-james-01.jpg' | prepend: site.baseurl }}"
172-
alt="Headshot of James" />
176+
{%
177+
include picture-with-webp.html
178+
class="testimonial-avatar"
179+
image="/images/advertising/headshots/competitor-james-01.jpg"
180+
alt="Headshot of James"
181+
%}
173182
</div>
174183
</div>
175184
</div>

0 commit comments

Comments
 (0)