Skip to content

Commit

Permalink
feature(documentation-website): introduce automatic image conversion
Browse files Browse the repository at this point in the history
fixes #927
  • Loading branch information
Idrinth committed May 2, 2024
1 parent ff88527 commit 7438a51
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion documentation-website/src/components/contributor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ const Contributor = ({
return <div
id={id}
className={'contributor'}>
<img src={avatar} alt={name}/>
<picture>
<source src={avatar.replace(/jpg$/u, 'avif',)} type="image/avif"/>
<source src={avatar.replace(/jpg$/u, 'webp',)} type="image/webp"/>
<img src={avatar} alt={name}/>
</picture>
<div>
<h2>
<a href={`#${ id }`}>#</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Index = () => {
.map((contributor,) => <Contributor
key={contributor.id}
name={contributor.name}
avatar={`/assets/contributors/${ contributor.id }.webp`}
avatar={`/assets/contributors/${ contributor.id }.jpg`}
url={contributor.url}
location={contributor.location}
contributions={contributor.contributions}
Expand Down
2 changes: 1 addition & 1 deletion documentation-website/tools/load-contributors.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if (! process.env.CI) {
users[user.login] = {
contributions: contributor.contributions,
name: user.name || user.login,
avatar: '/assets/profile-' + hash + '.webp',
avatar: '/assets/profile-' + hash + '.jpg',
url: user.html_url,
bio: user.bio || defaultBio,
location: user.location || 'unknown',
Expand Down

0 comments on commit 7438a51

Please sign in to comment.