From d8b766ddf82316727a6f8fad6e3df4e470d8fa9b Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 13 Apr 2024 15:42:53 -0300 Subject: content: image: remove width/height slots --- src/content/dependencies/transformContent.js | 36 +++++++++++++++------------- 1 file changed, 20 insertions(+), 16 deletions(-) (limited to 'src/content/dependencies/transformContent.js') diff --git a/src/content/dependencies/transformContent.js b/src/content/dependencies/transformContent.js index f1ea957e..0904cde6 100644 --- a/src/content/dependencies/transformContent.js +++ b/src/content/dependencies/transformContent.js @@ -294,6 +294,25 @@ export default { const image = relations.images[imageIndex++]; + image.setSlots({ + src, + + link: link ?? true, + warnings: warnings ?? null, + thumb: slots.thumb, + }); + + if (width || height) { + image.setSlot('dimensions', [width ?? null, height ?? null]); + } + + image.setSlot('attributes', [ + {class: 'content-image'}, + + pixelate && + {class: 'pixelate'}, + ]); + return { type: 'processed-image', inline: false, @@ -302,22 +321,7 @@ export default { align === 'center' && {class: 'align-center'}, - image.slots({ - src, - - link: link ?? true, - width: width ?? null, - height: height ?? null, - warnings: warnings ?? null, - thumb: slots.thumb, - - attributes: [ - {class: 'content-image'}, - - pixelate && - {class: 'pixelate'}, - ], - })), + image), }; } -- cgit 1.3.0-6-gf8a5