forked from ORGANISATION-KA-INTERNATIONALE/FEDIVERSE-OKI
Optimise les images distantes au build et fiabilise la QA
- scripts/fetch-podcast-cover.mjs : pochettes Castopod (flux + épisodes) téléchargées et converties en WebP 512px au prebuild (2,3 Mo → 59 Ko) - scripts/optimize-remote-images.mjs : vignettes PeerTube (640px), avatars (96px) et médias Mastodon (800px) optimisés en WebP + mapping src/lib/server/image-map.json consommé par mapImage() - a11y : liens footer soulignés dans les paragraphes, cibles tactiles ≥24px sur les liens des posts Mastodon - image-map.ts : import JSON statique (le createRequire pointait sur le bundle) - doc : étape prebuild documentée (dépendance ImageMagick) Lighthouse mobile : 97/100/100/100 — LCP 2,4s, TBT 50ms, CLS 0, poids accueil 900 Ko (budgets du playbook respectés)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { peertube } from '$lib/config';
|
||||
import { fetchJson, markdownToHtml, sanitizeHtml } from './http';
|
||||
import { mapImage } from './image-map';
|
||||
import type {
|
||||
DownloadOption,
|
||||
SearchEntry,
|
||||
@@ -44,11 +45,11 @@ function formatVideos(videos: PtVideo[] = []): VideoSummary[] {
|
||||
return videos.map((video) => ({
|
||||
id: video.uuid,
|
||||
title: video.name,
|
||||
thumbnail: video.previewPath ? `${BASE}${video.previewPath}` : '/images/logo.png',
|
||||
thumbnail: video.previewPath ? mapImage(`${BASE}${video.previewPath}`) : '/images/logo.png',
|
||||
duration: video.duration,
|
||||
channel: video.channel?.displayName ?? '',
|
||||
channelAvatar: video.channel?.avatars?.[0]?.path
|
||||
? `${BASE}${video.channel.avatars[0].path}`
|
||||
? mapImage(`${BASE}${video.channel.avatars[0].path}`)
|
||||
: '/images/logo.png',
|
||||
views: video.views,
|
||||
date: video.publishedAt,
|
||||
|
||||
Reference in New Issue
Block a user