Skip to content

Commit 328b6e1

Browse files
committed
Fetch LCP image on home with high priority
1 parent 7d80be9 commit 328b6e1

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

site/plugins/site/helpers/html.php

+10-9
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,16 @@ function img($file, array $props = [])
5959
$height ??= $file->height();
6060

6161
$img = '<img ' . attr([
62-
'alt' => $props['alt'] ?? '',
63-
'class' => $props['class'] ?? null,
64-
'style' => $props['style'] ?? null,
65-
'loading' => $loading ?? null,
66-
'sizes' => $sizes,
67-
'src' => $src,
68-
'srcset' => $srcset ?? null,
69-
'width' => $width,
70-
'height' => $height
62+
'alt' => $props['alt'] ?? '',
63+
'class' => $props['class'] ?? null,
64+
'style' => $props['style'] ?? null,
65+
'loading' => $loading ?? null,
66+
'fetchpriority' => $props['fetchpriority'] ?? null,
67+
'sizes' => $sizes,
68+
'src' => $src,
69+
'srcset' => $srcset ?? null,
70+
'width' => $width,
71+
'height' => $height
7172
]) . '>';
7273

7374
if (empty($props['lightbox']) === false && $props['lightbox'] !== false) {

site/snippets/templates/home/playground/header.php

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class="playground-header-figure-wrapper"
2626
'width' => 1520
2727
],
2828
'lazy' => false,
29+
'fetchpriority' => 'high',
2930
// sizes generated with https://ausi.github.io/respimagelint/
3031
'sizes' => '(min-width: 1860px) 1520px, (min-width: 820px) calc(92.16vw - 176px), 100vw',
3132
'srcset' => [

0 commit comments

Comments
 (0)