feat: enhance channel favicon with dynamic resizing

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
This commit is contained in:
ccbikai
2024-12-22 19:24:32 +08:00
parent 72688949ba
commit a4ee6ef435

View File

@@ -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',
},
],
},
}