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 7abe287
Show file tree
Hide file tree
Showing 9 changed files with 42 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>
28 changes: 19 additions & 9 deletions governance.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
layout: page
title: Governance
permalink: /governance/
# cspell:ignore headshots
---
<div class="panel panel-header panel-boxes">
<div class="hero-container panel-container">
Expand Down Expand Up @@ -45,9 +46,12 @@ <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"
%}
</div>
</div>
<div class="row vertically-centered-row trustee-row">
Expand All @@ -60,9 +64,12 @@ <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"
%}
</div>
</div>
<div class="row vertically-centered-row trustee-row">
Expand All @@ -74,9 +81,12 @@ <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"
%}
</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.
28 changes: 19 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
layout: home
# cspell:ignore headshots
---
<div class="panel">
<div class="fixed-width">
Expand Down Expand Up @@ -127,9 +128,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 +150,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 +174,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 7abe287

Please sign in to comment.