Skip to content

Commit

Permalink
feat: enhance channel favicon with dynamic resizing
Browse files Browse the repository at this point in the history
Implements dynamic favicon handling using wsrv.nl image service:
- Resizes channel avatar to 64x64
- Applies circular mask for consistent appearance
- Ensures HTTPS compatibility by stripping protocol
- Falls back to default favicon when no avatar exists

Improves visual consistency across different platforms and scales
  • Loading branch information
ccbikai committed Dec 22, 2024
1 parent 7268894 commit a4ee6ef
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/layouts/base.astro
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ const seoParams = {
},
},
extend: {
link: [{ rel: 'icon', href: channel?.avatar ? channel?.avatar : '/favicon.svg' }],
link: [
{
rel: 'icon',
href: channel?.avatar
? `https://wsrv.nl/?w=64&h=64&fit=cover&mask=circle&url=ssl:${channel?.avatar?.replace(/^https?:\/\//, '')}`
: '/favicon.svg',
},
],
},
}
Expand Down

0 comments on commit a4ee6ef

Please sign in to comment.