diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-04-13 15:42:53 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-04-13 15:47:35 -0300 |
commit | d8b766ddf82316727a6f8fad6e3df4e470d8fa9b (patch) | |
tree | 87d58c0f0687c1d4f8c55fa7f3d8abf3cf0c785a /src/content/dependencies/transformContent.js | |
parent | 3d1a1383e83b438dc3ffe0e3187fa2b36828d330 (diff) |
content: image: remove width/height slots
Diffstat (limited to 'src/content/dependencies/transformContent.js')
-rw-r--r-- | src/content/dependencies/transformContent.js | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/src/content/dependencies/transformContent.js b/src/content/dependencies/transformContent.js index f1ea957..0904cde 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), }; } |