Website 1.6.0: real photos for the demo church, photos sized to their frames
The demo church (and the eight demo profiles) used one generated "hills and sun" SVG for every picture. Now 104 Unsplash stock photos (models; free under the Unsplash License, credited in backend/demo-photos/CREDITS.md): a set per profile, a portrait for every leader (before: only the pastor), a picture for each event, and a photo for each message instead of the stand-in video's thumbnail. Demo photos go through processImage like an upload, made once per machine and copied; without demo-photos/ the illustration still stands in. A message's thumbnailUrl that is one of the site's own uploads now comes before the YouTube thumbnail; admins and the YouTube feed store YouTube's address there, so a church's own messages are unchanged. Faster on phones: the Community collage hero, the collage row, the team's portraits and the ministry cards give the browser their real width (sizes), so a phone no longer fetches the full-width photo for a small frame. Checked: backend tests (131), Website e2e (130, baselines retaken; Lighthouse mobile 90-98 performance, 100 accessibility and SEO), typecheck, lint and both builds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -82,8 +82,14 @@ function brandFor(church: Church | null, template: WebsiteTemplate) {
|
||||
/** Where the site serves a YouTube video's thumbnail from (site/thumbnails.ts): visitors never ask YouTube. */
|
||||
export const thumbnailPath = (videoId: string) => `/api/thumbnails/${videoId}.jpg`;
|
||||
|
||||
/** A message's thumbnail on the site: its YouTube video's, served from here; none for Spotify. */
|
||||
export function messageThumbnail(m: { source: string; mediaUrl: string }) {
|
||||
/**
|
||||
* A message's thumbnail on the site: its YouTube video's, served from here; none for Spotify. A
|
||||
* `thumbnailUrl` that is one of the site's own uploads comes first: the demo church's messages
|
||||
* have photos, while their video is a stand-in (admins and the YouTube feed store YouTube's
|
||||
* address there, which is never used).
|
||||
*/
|
||||
export function messageThumbnail(m: { source: string; mediaUrl: string; thumbnailUrl?: string | null }) {
|
||||
if (m.thumbnailUrl && /^\/api\/uploads\/[\w./-]+$/.test(m.thumbnailUrl) && !m.thumbnailUrl.includes('..')) return m.thumbnailUrl;
|
||||
const yt = m.source === 'spotify' ? null : youtubeId(m.mediaUrl);
|
||||
return yt ? thumbnailPath(yt) : null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user