Skip to content

Commit 24416cb

Browse files
committed
hero img improvements
1 parent 7d54224 commit 24416cb

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

_data/conf.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ online-only-conference: false
1212
###########################
1313
# Hero
1414
###########################
15-
# Place hero image in /assets/img/theme-images/
15+
# Place hero image in /assets/img/theme-images/. Includes optional webp format.
1616
hero-image-filename: 'buffalo.png'
1717
hero-image-source: ''
18-
hero-image-alt: ''
18+
hero-image-filename-webp: 'buffalo.webp'
19+
hero-image-alt: 'The skyline of Buffalo, New York. White lightning bolts and stars are in the background, representing the Buffalo city flag.'
1920

2021
image-attributions:
2122
- attribution:

_includes/homepage/jumbotron.html

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
<div class="jumbotron">
33

44
<div class="hero-image">
5-
<img src="/assets/img/theme-images/{{ site.data.conf.hero-image-filename | site.data.conf.hero-image-source }}" alt="{{ site.data.conf.hero-image-alt }}">
5+
<picture>
6+
{% if site.data.conf.hero-image-filename-webp != empty %}
7+
<source srcset="/assets/img/theme-images/{{ site.data.conf.hero-image-filename-webp }}" type="image/webp">
8+
{% endif %}
9+
<img src="/assets/img/theme-images/{{ site.data.conf.hero-image-filename | site.data.conf.hero-image-source }}" alt="{{ site.data.conf.hero-image-alt }}">
10+
</picture>
611
</div>
712

813
<div class="container-fluid">

assets/_scss/_homepage.scss

+3-1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@
7070
.hero-image img {
7171
height: 100%;
7272
width: auto;
73+
object-fit: cover;
74+
object-position: top right;
7375
}
7476

7577
/*
@@ -78,7 +80,7 @@
7880
2019 note: This math did not work out for a 2876x913 image, where min-width in line 152 should have, according to above math, been 1020. Instead 1160 is the number that works with this year's hero image.
7981
*/
8082

81-
@media (min-width: 1160px) {
83+
@media (min-width: 890px) {
8284
.hero-image img {
8385
width: 100%;
8486
}

assets/img/theme-images/buffalo.png

-5.92 MB
Loading

assets/img/theme-images/buffalo.webp

377 KB
Binary file not shown.

0 commit comments

Comments
 (0)