summary refs log tree commit diff stats
path: root/templates/gallery.crotmp
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2022-06-10 23:13:14 +0530
committerAndinus <andinus@nand.sh>2022-06-10 23:16:27 +0530
commitbef200b4669f058ce43ec9c0a3583de7fac558e3 (patch)
tree0b25b603e5ba3f46c2c8396cfcf036923771471e /templates/gallery.crotmp
parent3a443f9380478ab30a2ba7dc173f5e6de880de03 (diff)
downloadcrater-bef200b4669f058ce43ec9c0a3583de7fac558e3.tar.gz
Add alt tags to images, fix flash of unstyled content
- FOUC: On firefox, maybe the '@import' rule caused this.

Also tried out lightGallery.js for lightbox, it doesn't work with text
& anyways, it's buggy with bricks.js & you have to request license key.
Diffstat (limited to 'templates/gallery.crotmp')
-rw-r--r--templates/gallery.crotmp36
1 files changed, 15 insertions, 21 deletions
diff --git a/templates/gallery.crotmp b/templates/gallery.crotmp
index 25c55ea..6afef0a 100644
--- a/templates/gallery.crotmp
+++ b/templates/gallery.crotmp
@@ -1,24 +1,18 @@
 <:use 'templates/base.crotmp'>
-<|page(.title)>
-<div id="gallery">
-    <@gallery : $i>
-
-    <?{ $i.<type> eq 'img' }>
-    <img src="<$i.<src>>" loading="lazy">
-    </?>
-
-    <?{ $i.<type> eq 'text' }>
-    <div class="text">
-        <$i.<text>>
+  <|page(.title)>
+    <div id="gallery">
+      <@gallery : $i>
+        <?{ $i.<type> eq 'img' }>
+        <img alt="<$i.<alt>>" src="<$i.<src>>" loading="lazy">
+        </?>
+        <?{ $i.<type> eq 'text' }>
+        <div class="text"><$i.<text>></div>
+        </?>
+        <?{ $i.<type> eq 'heading' }>
+        <h1 class="heading"><$i.<text>></h1>
+        </?>
+      </@>
     </div>
-    </?>
-
-    <?{ $i.<type> eq 'heading' }>
-    <h1 class="heading"><$i.<text>></h1>
-    </?>
-
-    </@>
-</div>
-<script type="text/javascript" src="/resources/js/bricks.js"></script>
-<script type="text/javascript" src="/resources/js/gallery.js"></script>
+    <script type="text/javascript" src="/resources/js/bricks.js"></script>
+    <script type="text/javascript" src="/resources/js/gallery.js"></script>
 </|>