« get me outta code hell

content: generateCoverGrid: per-item info line - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-06-23 20:18:29 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-06-23 20:18:29 -0300
commitee379f01bb93c3de839ade397eb171fae34d2a6b (patch)
tree2a505f88f27aacdfc1bc90d08676a33e01723e45
parentc023b206b4c9a72b935042bf61ce42067ce1a2f0 (diff)
content: generateCoverGrid: per-item info line
-rw-r--r--src/content/dependencies/generateCoverGrid.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/content/dependencies/generateCoverGrid.js b/src/content/dependencies/generateCoverGrid.js
index 970aa05c..e9f770f0 100644
--- a/src/content/dependencies/generateCoverGrid.js
+++ b/src/content/dependencies/generateCoverGrid.js
@@ -7,6 +7,7 @@ export default {
     images: {validate: v => v.arrayOf(v.isHTML)},
     links: {validate: v => v.arrayOf(v.isHTML)},
     names: {validate: v => v.arrayOf(v.isString)},
+    info: {validate: v => v.arrayOf(v.isString)},
 
     lazy: {validate: v => v.oneOf(v.isWholeNumber, v.isBoolean)},
   },
@@ -18,7 +19,8 @@ export default {
           image: slots.images,
           link: slots.links,
           name: slots.names,
-        }).map(({image, link, name}, index) =>
+          info: slots.info,
+        }).map(({image, link, name, info}, index) =>
             link.slots({
               attributes: {class: ['grid-item', 'box']},
               content: [
@@ -32,7 +34,8 @@ export default {
                       ? slots.lazy
                       : false),
                 }),
-                html.tag('span', name),
+                html.tag('span', {[html.onlyIfContent]: true}, name),
+                html.tag('span', {[html.onlyIfContent]: true}, info),
               ],
             }))));
   },