Skip to content

Commit 2ffd195

Browse files
nickyfotoclaude
andcommitted
fix(route/nfl): strip Cloudinary t_lazy transformation from image URLs
The data-src URLs contain /t_lazy/ which returns a blurred placeholder. Remove that segment so feed readers load the full-resolution image. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2ffeb63 commit 2ffd195

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/routes/nfl/news.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,17 @@ async function handler(ctx) {
170170
const content = $article(selector);
171171
if (content.length) {
172172
content.find('script, style, [data-ad], .ad, .social-share, .related-content').remove();
173-
// Fix lazy-loaded images: real URLs live in data-src/data-srcset, src is a placeholder GIF
173+
// Fix lazy-loaded images: real URLs live in data-src/data-srcset, src is a placeholder GIF.
174+
// Also strip the Cloudinary "/t_lazy/" transformation which returns a blurred placeholder.
175+
const unlazy = (url: string) => url.replaceAll('/t_lazy/', '/');
174176
content.find('img[data-src]').each((_, img) => {
175177
const $img = $article(img);
176-
$img.attr('src', $img.attr('data-src')!);
178+
$img.attr('src', unlazy($img.attr('data-src')!));
177179
$img.removeAttr('data-src');
178180
});
179181
content.find('source[data-srcset]').each((_, src) => {
180182
const $src = $article(src);
181-
$src.attr('srcset', $src.attr('data-srcset')!);
183+
$src.attr('srcset', unlazy($src.attr('data-srcset')!));
182184
$src.removeAttr('data-srcset');
183185
});
184186
const html = content

0 commit comments

Comments
 (0)