summaryrefslogtreecommitdiff
path: root/pages/shop/index.fnl
diff options
context:
space:
mode:
Diffstat (limited to 'pages/shop/index.fnl')
-rw-r--r--pages/shop/index.fnl19
1 files changed, 12 insertions, 7 deletions
diff --git a/pages/shop/index.fnl b/pages/shop/index.fnl
index 0b9336e..06642a5 100644
--- a/pages/shop/index.fnl
+++ b/pages/shop/index.fnl
@@ -61,13 +61,18 @@
[:img {:class "shop-item-img"
:src (.. "/static/files/" (. product.image1) "-thumbnail.jpg")}]
(table.concat
- (icollect [idx image (ipairs images)]
- (HTML
- [:img {:class "shop-item-img" :src (.. "/static/files/" image "-thumbnail.jpg")
- :loading "lazy"
- :style (.. "z-index: " (+ idx 2) ";"
- "width: calc(100% / " (# images) ");"
- "left: calc(100% / " (# images) " * " (- idx 1) ")")}])))]]
+ (let [without-videos
+ (icollect [_ v (ipairs images)]
+ (if (lib.ends-with? (_G.must (luna.utf8.lower v)) ".webm")
+ nil
+ v))]
+ (icollect [idx image (ipairs without-videos)]
+ (HTML
+ [:img {:class "shop-item-img" :src (.. "/static/files/" image "-thumbnail.jpg")
+ :loading "lazy"
+ :style (.. "z-index: " (+ idx 2) ";"
+ "width: calc(100% / " (# without-videos) ");"
+ "left: calc(100% / " (# without-videos) " * " (- idx 1) ")")}]))))]]
[:a {:href item-url} [:h3 {:class "shop-item-title"} product.title]]
[:div {:style "font-style: italic; margin-bottom: 0.25rem;"}
(or (dicts.label dicts.product-type product.type) product.type) ", "