Skip to content

Commit 07bfa41

Browse files
committed
srcsets
1 parent 0d5c2e0 commit 07bfa41

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

default.hbs

+7-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99

1010
{{#is "home"}}
1111
{{#if @site.cover_image}}
12+
{{#match @custom.header_section_layout "Large background"}}
1213
<link rel="preload" as="image" href="{{@site.cover_image}}">
14+
{{else match @custom.header_section_layout "Side by side"}}
15+
<link rel="preload" as="image" href="{{img_url @site.cover_image size="m"}}">
16+
{{/match}}
17+
1318
{{/if}}
1419
{{/is}}
1520

@@ -46,8 +51,8 @@
4651
<a class="gh-head-logo" href="{{@site.url}}">
4752
{{#if @site.logo}}
4853
<img srcset="{{img_url @site.logo size="s"}} 300w,
49-
{{img_url @site.logo size="m"}} 600w"
50-
sizes="(max-width: 600px) 50vw, 40vw"
54+
{{img_url @site.logo size="m"}} 720w"
55+
sizes="90vw"
5156
src="{{img_url @site.logo size="s"}}" alt="{{@site.title}}"
5257
>
5358
{{else}}

index.hbs

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
{{#if @site.cover_image}}
1919
<img class="gh-about-image"
2020
srcset="{{img_url @site.cover_image size="s"}} 300w,
21-
{{img_url @site.cover_image size="m"}} 720w,
22-
{{img_url @site.cover_image size="l"}} 960w"
23-
sizes="(max-width: 840px) 100vw, 50vw"
21+
{{img_url @site.cover_image size="m"}} 720w"
22+
sizes="(max-width: 720px) 100vw, 50vw"
2423
src="{{@site.cover_image}}" alt="{{@site.title}}">
2524
{{/if}}
2625
{{/match}}

partials/loop.hbs

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@
88
{{#match @custom.post_feed_layout "Parallax"}}class="jarallax-img"{{/match}}
99
srcset="{{img_url feature_image size="s"}} 300w,
1010
{{img_url feature_image size="m"}} 720w,
11-
{{img_url feature_image size="l"}} 960w,
11+
{{img_url feature_image size="l"}} 960w
12+
{{#match @custom.post_feed_layout "=" "Parallax"}},
1213
{{img_url feature_image size="xl"}} 1200w,
1314
{{img_url feature_image size="xxl"}} 2000w"
14-
sizes="(max-width: 1200px) 100vw, 1200px"
15+
sizes="(max-width: 1440px) 100vw, 1440px"
16+
{{else}}
17+
sizes="(max-width: 991px) 100vw, 50vw"
18+
{{/match}}
1519
src="{{img_url feature_image size="m"}}"
1620
alt="{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}"
1721
>

0 commit comments

Comments
 (0)