Skip to content

Commit

Permalink
Support WEBP versions of single images and use this for avatars
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
PeterJCLaw committed May 14, 2023
1 parent 8df7526 commit f380a4e
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 18 deletions.
4 changes: 4 additions & 0 deletions _includes/picture-with-webp.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<picture>
<source srcset="{{ site.baseurl }}{{ include.image }}.webp" type="image/webp" />
<img class="{{ include.class }}" src="{{ site.baseurl }}{{ include.image }}" alt="{{ include.alt }}" />
</picture>
30 changes: 21 additions & 9 deletions governance.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,13 @@ <h3>Diane Dowling</h3>
</p>
</div>
<div class="column m-3-12 horizontally-centered-column">
<img class="trustee-avatar"
src="{{ '/images/advertising/headshots/trustee-diane-01.jpg' | prepend: site.baseurl }}"
alt="Headshot of Diane" />
{%
include picture-with-webp.html
class="trustee-avatar"
image="/images/advertising/headshots/trustee-diane-01.jpg"
alt="Headshot of Diane"
%}
</picture>
</div>
</div>
<div class="row vertically-centered-row trustee-row">
Expand All @@ -60,9 +64,13 @@ <h3>David Massey</h3>
</p>
</div>
<div class="column m-3-12 horizontally-centered-column">
<img class="trustee-avatar"
src="{{ '/images/advertising/headshots/trustee-david-01.jpg' | prepend: site.baseurl }}"
alt="Headshot of David" />
{%
include picture-with-webp.html
class="trustee-avatar"
image="/images/advertising/headshots/trustee-david-01.jpg"
alt="Headshot of David"
%}
</picture>
</div>
</div>
<div class="row vertically-centered-row trustee-row">
Expand All @@ -74,9 +82,13 @@ <h3>Thomas "Scarzy" Scarsbrook</h3>
</p>
</div>
<div class="column m-3-12 horizontally-centered-column">
<img class="trustee-avatar"
src="{{ '/images/advertising/headshots/trustee-scarzy-01.jpg' | prepend: site.baseurl }}"
alt="Headshot of Thomas" />
{%
include picture-with-webp.html
class="trustee-avatar"
image="/images/advertising/headshots/trustee-scarzy-01.jpg"
alt="Headshot of Thomas"
%}
</picture>
</div>
</div>
</div>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
27 changes: 18 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,12 @@ <h2 class="text-center">Testimonials</h2>
</p>
</div>
<div class="column m-3-12 horizontally-centered-column">
<img class="testimonial-avatar"
src="{{ '/images/advertising/headshots/competitor-phil-01.jpg' | prepend: site.baseurl }}"
alt="Headshot of Phil" />
{%
include picture-with-webp.html
class="testimonial-avatar"
image="/images/advertising/headshots/competitor-phil-01.jpg"
alt="Headshot of Phil"
%}
</div>
</div>
<div class="row vertically-centered-row top-spacing testimonial-row">
Expand All @@ -146,9 +149,12 @@ <h2 class="text-center">Testimonials</h2>
</p>
</div>
<div class="column m-3-12 horizontally-centered-column">
<img class="testimonial-avatar"
src="{{ '/images/advertising/headshots/competitor-becky-01.jpg' | prepend: site.baseurl }}"
alt="Headshot of Becky" />
{%
include picture-with-webp.html
class="testimonial-avatar"
image="/images/advertising/headshots/competitor-becky-01.jpg"
alt="Headshot of Becky"
%}
</div>
</div>
<div class="row vertically-centered-row top-spacing testimonial-row">
Expand All @@ -167,9 +173,12 @@ <h2 class="text-center">Testimonials</h2>
</p>
</div>
<div class="column m-3-12 horizontally-centered-column">
<img class="testimonial-avatar"
src="{{ '/images/advertising/headshots/competitor-james-01.jpg' | prepend: site.baseurl }}"
alt="Headshot of James" />
{%
include picture-with-webp.html
class="testimonial-avatar"
image="/images/advertising/headshots/competitor-james-01.jpg"
alt="Headshot of James"
%}
</div>
</div>
</div>
Expand Down

0 comments on commit f380a4e

Please sign in to comment.