From bac20775287af2e73121f511254f3640355326ed Mon Sep 17 00:00:00 2001 From: Darren Griffin Date: Mon, 10 Mar 2025 13:37:13 +0000 Subject: [PATCH 1/4] Uppercase distributor names to fix sorting --- source/_data/products.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/source/_data/products.yml b/source/_data/products.yml index b7f99fa9aaf..6b5c606c2bd 100644 --- a/source/_data/products.yml +++ b/source/_data/products.yml @@ -7,7 +7,7 @@ green: ship_to: America url: https://www.amazon.com/dp/B0CXVKSG19?maas=maas_adg_BB51722E249D328CABB2F6DF1F8976CC_afap_abs&ref_=aa_maas&tag=maas logo: /images/distributors/amazon.webp - - name: ameriDroid + - name: AmeriDroid ship_from: US ship_to: America url: https://ameridroid.com/products/home-assistant-green @@ -70,7 +70,7 @@ green: ship_to: Europe url: https://shop.everythingsmart.io/products/home-assistant-green logo: /images/distributors/est.webp - - name: eWeLink device store + - name: EWeLink device store ship_from: Hungary ship_to: Europe url: https://ewelinkstore.com/product/home-assistant-green-hub/ @@ -95,12 +95,12 @@ green: ship_to: Europe url: https://mauser.pt/catalog/product_info.php?products_id=095-3152 logo: /images/distributors/mauser.png - - name: mediarath + - name: Mediarath ship_from: Germany ship_to: Europe url: https://mediarath.de/products/home-assistant-green-smart-home-hub-2x-usb-gigabit-lan-hmdi-microsd-slot logo: /images/distributors/mediarath.de.webp - - name: m.nu + - name: M.nu ship_from: Sweden ship_to: Europe url: https://en.m.nu/controllers-smart-hubs/home-assistant-green @@ -164,7 +164,7 @@ yellow: name: "Home Assistant Yellow" distributors: # America - - name: ameriDroid + - name: AmeriDroid ship_from: US ship_to: America url: https://ameridroid.com/products/home-assistant-yellow @@ -226,7 +226,7 @@ zbt-1: name: "Home Assistant Connect ZBT-1" distributors: # America - - name: ameriDroid + - name: AmeriDroid ship_from: US ship_to: America url: https://ameridroid.com/products/skyconnect @@ -279,7 +279,7 @@ zbt-1: ship_to: Europe url: https://shop.everythingsmart.io/products/home-assistant-skyconnect logo: /images/distributors/est.webp - - name: eWeLink device store + - name: EWeLink device store ship_from: Hungary ship_to: Europe url: https://ewelinkstore.com/product/home-assistant-connect-zbt-1-a-zigbee-thread-matter-usb-stick/ @@ -299,12 +299,12 @@ zbt-1: ship_to: Europe url: https://mauser.pt/catalog/product_info.php?products_id=095-1222 logo: /images/distributors/mauser.png - - name: mediarath + - name: Mediarath ship_from: Germany ship_to: Europe url: https://mediarath.de/products/home-assistant-connect-zbt-1-zigbee-thread-matter-usb-stick-fur-home-assistant-skyconnect logo: /images/distributors/mediarath.de.webp - - name: m.nu + - name: M.nu ship_from: Sweden ship_to: Europe url: https://en.m.nu/zigbee/controllers-zigbee/home-assistant-skyconnect-zigbee-matter-thread @@ -368,7 +368,7 @@ voice-pe: name: "Home Assistant Voice Preview Edition" distributors: # America - - name: ameriDroid + - name: AmeriDroid ship_from: US ship_to: America url: https://ameridroid.com/products/home-assistant-voice-preview-edition/ From a7609f83bd0f733f64212491df95040e181ecab5 Mon Sep 17 00:00:00 2001 From: Darren Griffin Date: Mon, 10 Mar 2025 14:09:02 +0000 Subject: [PATCH 2/4] Undo naming change --- source/_data/products.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/source/_data/products.yml b/source/_data/products.yml index 6b5c606c2bd..b7f99fa9aaf 100644 --- a/source/_data/products.yml +++ b/source/_data/products.yml @@ -7,7 +7,7 @@ green: ship_to: America url: https://www.amazon.com/dp/B0CXVKSG19?maas=maas_adg_BB51722E249D328CABB2F6DF1F8976CC_afap_abs&ref_=aa_maas&tag=maas logo: /images/distributors/amazon.webp - - name: AmeriDroid + - name: ameriDroid ship_from: US ship_to: America url: https://ameridroid.com/products/home-assistant-green @@ -70,7 +70,7 @@ green: ship_to: Europe url: https://shop.everythingsmart.io/products/home-assistant-green logo: /images/distributors/est.webp - - name: EWeLink device store + - name: eWeLink device store ship_from: Hungary ship_to: Europe url: https://ewelinkstore.com/product/home-assistant-green-hub/ @@ -95,12 +95,12 @@ green: ship_to: Europe url: https://mauser.pt/catalog/product_info.php?products_id=095-3152 logo: /images/distributors/mauser.png - - name: Mediarath + - name: mediarath ship_from: Germany ship_to: Europe url: https://mediarath.de/products/home-assistant-green-smart-home-hub-2x-usb-gigabit-lan-hmdi-microsd-slot logo: /images/distributors/mediarath.de.webp - - name: M.nu + - name: m.nu ship_from: Sweden ship_to: Europe url: https://en.m.nu/controllers-smart-hubs/home-assistant-green @@ -164,7 +164,7 @@ yellow: name: "Home Assistant Yellow" distributors: # America - - name: AmeriDroid + - name: ameriDroid ship_from: US ship_to: America url: https://ameridroid.com/products/home-assistant-yellow @@ -226,7 +226,7 @@ zbt-1: name: "Home Assistant Connect ZBT-1" distributors: # America - - name: AmeriDroid + - name: ameriDroid ship_from: US ship_to: America url: https://ameridroid.com/products/skyconnect @@ -279,7 +279,7 @@ zbt-1: ship_to: Europe url: https://shop.everythingsmart.io/products/home-assistant-skyconnect logo: /images/distributors/est.webp - - name: EWeLink device store + - name: eWeLink device store ship_from: Hungary ship_to: Europe url: https://ewelinkstore.com/product/home-assistant-connect-zbt-1-a-zigbee-thread-matter-usb-stick/ @@ -299,12 +299,12 @@ zbt-1: ship_to: Europe url: https://mauser.pt/catalog/product_info.php?products_id=095-1222 logo: /images/distributors/mauser.png - - name: Mediarath + - name: mediarath ship_from: Germany ship_to: Europe url: https://mediarath.de/products/home-assistant-connect-zbt-1-zigbee-thread-matter-usb-stick-fur-home-assistant-skyconnect logo: /images/distributors/mediarath.de.webp - - name: M.nu + - name: m.nu ship_from: Sweden ship_to: Europe url: https://en.m.nu/zigbee/controllers-zigbee/home-assistant-skyconnect-zigbee-matter-thread @@ -368,7 +368,7 @@ voice-pe: name: "Home Assistant Voice Preview Edition" distributors: # America - - name: AmeriDroid + - name: ameriDroid ship_from: US ship_to: America url: https://ameridroid.com/products/home-assistant-voice-preview-edition/ From a68e488faddf36e26bfc80ba59b7c76c8d60f99b Mon Sep 17 00:00:00 2001 From: Darren Griffin Date: Mon, 10 Mar 2025 14:13:28 +0000 Subject: [PATCH 3/4] Add alternative filter for case insensitive sort --- plugins/filters.rb | 5 +++++ source/_includes/custom/buy-dialog.html | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/filters.rb b/plugins/filters.rb index 696f9b53199..2a6025c1cbb 100644 --- a/plugins/filters.rb +++ b/plugins/filters.rb @@ -125,6 +125,11 @@ module Jekyll end end end + + def case_insensitive_sort(input, key) + return input unless input.is_a?(Array) + input.sort_by { |item| item[key].to_s.downcase } + end end Liquid::Template.register_filter(Jekyll::AssetFilter) diff --git a/source/_includes/custom/buy-dialog.html b/source/_includes/custom/buy-dialog.html index b23bd14a2f5..fdf93e17631 100644 --- a/source/_includes/custom/buy-dialog.html +++ b/source/_includes/custom/buy-dialog.html @@ -29,7 +29,7 @@