]> git.draconx.ca Git - homepage.git/blobdiff - lib/helpers.rb
Use a denser style for gallery images.
[homepage.git] / lib / helpers.rb
index cc0bf046b6beb8e89c1950c8021ab8061c21ff8a..77916dd29492582da2081c4a4a116b7e32105ee1 100644 (file)
@@ -82,10 +82,8 @@ def img_rep_fallback(item, rep)
     return :large
 end
 
     return :large
 end
 
-def item_to_img(item, rep: :large, alt: nil, caption: nil)
-    unless item
-        return "[image not found]"
-    end
+def gallery_img(item, rep: :large, alt: nil, caption: nil)
+    return "[image not found]" unless item
 
     alt ||= item[:title]
     caption ||= alt
 
     alt ||= item[:title]
     caption ||= alt
@@ -98,12 +96,10 @@ def item_to_img(item, rep: :large, alt: nil, caption: nil)
 
     b = Nokogiri::XML::Builder.new do |xml|
         xml.a(:href => item_uri(item, rep: :info)) {
 
     b = Nokogiri::XML::Builder.new do |xml|
         xml.a(:href => item_uri(item, rep: :info)) {
-            xml.img(attrs)
+            xml.img(attrs, "generate-gallery" => "generate-gallery")
             unless caption.empty?
                 xml << " &#x2060;"
             unless caption.empty?
                 xml << " &#x2060;"
-                xml.small {
-                    xml << caption
-                }
+                xml.small { xml << caption }
             end
         }
     end
             end
         }
     end