|
1 | 1 | {% capture overlay_img_path %}{{ page.header.overlay_image | relative_url }}{% endcapture %} |
2 | 2 |
|
3 | | -{% if page.header.overlay_filter contains "gradient" %} |
4 | | - {% capture overlay_filter %}{{ page.header.overlay_filter }}{% endcapture %} |
5 | | -{% elsif page.header.overlay_filter contains "rgba" %} |
6 | | - {% capture overlay_filter %}{{ page.header.overlay_filter }}{% endcapture %} |
7 | | - {% capture overlay_filter %}linear-gradient({{ overlay_filter }}, {{ overlay_filter }}){% endcapture %} |
8 | | -{% elsif page.header.overlay_filter %} |
9 | | - {% capture overlay_filter %}rgba(0, 0, 0, {{ page.header.overlay_filter }}){% endcapture %} |
10 | | - {% capture overlay_filter %}linear-gradient({{ overlay_filter }}, {{ overlay_filter }}){% endcapture %} |
11 | | -{% endif %} |
12 | | - |
13 | 3 | {% if page.header.image_description %} |
14 | 4 | {% assign image_description = page.header.image_description %} |
15 | 5 | {% else %} |
16 | 6 | {% assign image_description = page.title %} |
17 | 7 | {% endif %} |
18 | 8 |
|
19 | 9 | {% assign image_description = image_description | markdownify | strip_html | strip_newlines | escape_once %} |
20 | | - |
| 10 | +<!-- Add support for webp and remove overlay filter --> |
21 | 11 | <div class="page__hero{% if page.header.overlay_color or page.header.overlay_image %}--overlay{% endif %}" |
22 | | - style="{% if page.header.overlay_color %}background-color: {{ page.header.overlay_color | default: 'transparent' }};{% endif %} {% if overlay_img_path %}background-image: {% if overlay_filter %}{{ overlay_filter }}, {% endif %}url('{{ overlay_img_path }}');{% endif %}" |
23 | | -> |
| 12 | + style=" |
| 13 | + {% if page.header.overlay_color %} |
| 14 | + background-color: {{ page.header.overlay_color | default: '#33205c' }}; |
| 15 | + {% endif %} |
| 16 | + {% if overlay_img_path %} |
| 17 | + background-image: image-set( |
| 18 | + url('{{ overlay_img_path | replace: '.png', '.webp' }}') 1x, |
| 19 | + url('{{ overlay_img_path }}') type('image/png') 2x |
| 20 | + ); |
| 21 | + {% endif %} |
| 22 | +"> |
24 | 23 | {% if page.header.overlay_color or page.header.overlay_image %} |
25 | 24 | <div class="wrapper"> |
26 | 25 | <h1 id="page-title" class="page__title" itemprop="headline"> |
|
0 commit comments