From 2171a81bfeacd58fd497319ae65f28e4252bd83b Mon Sep 17 00:00:00 2001
From: James Hunt <10615884+thetwopct@users.noreply.github.com>
Date: Sun, 29 Dec 2024 11:29:03 +0700
Subject: [PATCH 1/2] Update and optimise theme code
Signed-off-by: James Hunt <10615884+thetwopct@users.noreply.github.com>
---
.theme-check.yml | 7 +++++-
.vscode/settings.json | 2 +-
layout/password.liquid | 4 ++--
layout/theme.liquid | 35 +++++++++++++----------------
sections/collection-list.liquid | 2 +-
sections/email-signup-banner.liquid | 3 ---
sections/main-product.liquid | 2 +-
snippets/avada-em-setting.liquid | 6 ++---
snippets/locksmith.liquid | 6 ++---
templates/gift_card.liquid | 4 ++--
10 files changed, 34 insertions(+), 37 deletions(-)
diff --git a/.theme-check.yml b/.theme-check.yml
index f905bd4..5e85e3c 100644
--- a/.theme-check.yml
+++ b/.theme-check.yml
@@ -1,4 +1,9 @@
+# Added because we only use EN language.
MatchingTranslations:
enabled: false
-TemplateLength:
+# Added this to ignore our old variable naming scheme.
+VariableName:
+ enabled: false
+# Added this to ignore multiple errors from Locksmith
+UnusedAssign:
enabled: false
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 473ce01..b531f11 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -24,7 +24,7 @@
"strings": true
},
"editor.wordWrap": "off",
- "editor.renderFinalNewline": true,
+ "editor.renderFinalNewline": "on",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": false,
"html.format.wrapLineLength": 80,
diff --git a/layout/password.liquid b/layout/password.liquid
index d9018a9..debc10b 100644
--- a/layout/password.liquid
+++ b/layout/password.liquid
@@ -215,10 +215,10 @@
{% endstyle %}
{%- unless settings.type_body_font.system? -%}
-
+ {{ settings.type_body_font | font_url | preload_tag: as: 'font', type: 'font/woff2', crossorigin: 'anonymous' }}
{%- endunless -%}
{%- unless settings.type_header_font.system? -%}
-
+ {{ settings.type_header_font | font_url | preload_tag: as: 'font', type: 'font/woff2', crossorigin: 'anonymous' }}
{%- endunless -%}
{{ 'section-password.css' | asset_url | stylesheet_tag }}
diff --git a/layout/theme.liquid b/layout/theme.liquid
index 91222ea..53b0e15 100644
--- a/layout/theme.liquid
+++ b/layout/theme.liquid
@@ -1,31 +1,31 @@
{%- comment %}