From 942e91f20b38e700a9db17f94a7d900fe68d03b0 Mon Sep 17 00:00:00 2001 From: Sofia Matulis Date: Mon, 16 May 2022 15:38:06 -0400 Subject: [PATCH 01/13] Connect logo and cover image to settings --- config/settings_data.json | 6 ++- sections/header.liquid | 18 +++---- sections/image-banner.liquid | 79 +++++++++++++++------------- sections/main-password-header.liquid | 24 +++++---- templates/index.json | 1 + 5 files changed, 71 insertions(+), 57 deletions(-) diff --git a/config/settings_data.json b/config/settings_data.json index 4052ce3be3b..975746e3234 100644 --- a/config/settings_data.json +++ b/config/settings_data.json @@ -124,7 +124,8 @@ "menu": "main-menu", "show_line_separator": true, "enable_sticky_header": true, - "margin_bottom": 0 + "margin_bottom": 0, + "logo": "{{ shop.brand.logo }}" } }, "footer": { @@ -174,7 +175,8 @@ "type": "main-password-header", "settings": { "logo_max_width": 100, - "color_scheme": "background-1" + "color_scheme": "background-1", + "logo": "{{ shop.brand.logo }}" } }, "main-password-footer": { diff --git a/sections/header.liquid b/sections/header.liquid index 87dc21cecaa..7540ecbf48a 100644 --- a/sections/header.liquid +++ b/sections/header.liquid @@ -370,15 +370,15 @@ {%- endif -%} {%- if section.settings.logo != blank -%} - {%- assign image_size_2x = section.settings.logo_width | times: 2 | at_most: 5760 -%} - + {%- assign logo_alt = section.settings.logo.alt | default: shop.name | escape -%} + {% assign logo_height = section.settings.logo_width | divided_by: section.settings.logo.aspect_ratio %} + {{ section.settings.logo | image_url: width: section.settings.logo_width | image_tag: + loading: 'lazy', + class: 'header__heading-logo', + width: section.settings.logo.width, + height: logo_height, + alt: logo_alt + }} {%- else -%} {{ shop.name }} {%- endif -%} diff --git a/sections/image-banner.liquid b/sections/image-banner.liquid index 08a1fac7ede..ba62ff0d471 100644 --- a/sections/image-banner.liquid +++ b/sections/image-banner.liquid @@ -32,25 +32,27 @@