Skip to content

Commit 0d5c2e0

Browse files
committed
fix logo and hero image srcset
1 parent 97ea322 commit 0d5c2e0

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

default.hbs

+5-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@
4545
<div class="gh-head-brand-wrapper">
4646
<a class="gh-head-logo" href="{{@site.url}}">
4747
{{#if @site.logo}}
48-
<img src="{{@site.logo}}" alt="{{@site.title}}">
48+
<img srcset="{{img_url @site.logo size="s"}} 300w,
49+
{{img_url @site.logo size="m"}} 600w"
50+
sizes="(max-width: 600px) 50vw, 40vw"
51+
src="{{img_url @site.logo size="s"}}" alt="{{@site.title}}"
52+
>
4953
{{else}}
5054
{{@site.title}}
5155
{{/if}}

index.hbs

+21-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,27 @@
33
<section class="gh-about gh-outer{{#match @custom.header_section_layout "!=" "Typographic profile"}}{{#unless @site.cover_image}} no-image{{/unless}}{{else}}{{#unless @site.icon}} no-image{{/unless}}{{/match}}">
44
<div class="gh-about-inner gh-inner">
55
{{#match @custom.header_section_layout "!=" "Typographic profile"}}
6-
{{#if @site.cover_image}}
7-
<img class="gh-about-image" src="{{@site.cover_image}}" alt="{{@site.title}}">
8-
{{/if}}
6+
{{#match @custom.header_section_layout "=" "Large background"}}
7+
{{#if @site.cover_image}}
8+
<img class="gh-about-image"
9+
srcset="{{img_url @site.cover_image size="s"}} 300w,
10+
{{img_url @site.cover_image size="m"}} 720w,
11+
{{img_url @site.cover_image size="l"}} 960w,
12+
{{img_url @site.cover_image size="xl"}} 1200w,
13+
{{img_url @site.cover_image size="xxl"}} 2000w"
14+
sizes="100vw"
15+
src="{{@site.cover_image}}" alt="{{@site.title}}">
16+
{{/if}}
17+
{{else}}
18+
{{#if @site.cover_image}}
19+
<img class="gh-about-image"
20+
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"
24+
src="{{@site.cover_image}}" alt="{{@site.title}}">
25+
{{/if}}
26+
{{/match}}
927
{{else}}
1028
{{#if @site.icon}}
1129
<img class="gh-about-image" src="{{@site.icon}}" alt="{{@site.title}}">

0 commit comments

Comments
 (0)