From ee379f01bb93c3de839ade397eb171fae34d2a6b Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 23 Jun 2023 20:18:29 -0300 Subject: content: generateCoverGrid: per-item info line --- src/content/dependencies/generateCoverGrid.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') 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), ], })))); }, -- cgit 1.3.0-6-gf8a5