« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/image.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/content/dependencies/image.js b/src/content/dependencies/image.js
index db307a6b..134f99c9 100644
--- a/src/content/dependencies/image.js
+++ b/src/content/dependencies/image.js
@@ -61,8 +61,13 @@ export default {
 
     reveal: {type: 'boolean', default: true},
     lazy: {type: 'boolean', default: false},
+
     square: {type: 'boolean', default: false},
 
+    dimensions: {
+      validate: v => v.isDimensions,
+    },
+
     alt: {type: 'string'},
     width: {type: 'number'},
     height: {type: 'number'},
@@ -134,7 +139,10 @@ export default {
       !isMissingImageFile &&
       !empty(contentWarnings);
 
-    const willSquare = slots.square;
+    const willSquare =
+      (slots.dimensions
+        ? slots.dimensions[0] === slots.dimensions[1]
+        : slots.square);
 
     const imgAttributes = html.attributes([
       {class: 'image'},