From 8a647d1727bc5345c4bcb0066ff195c8e45beea4 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 6 Jun 2023 19:56:08 -0300 Subject: content: image: accept class as well as id attribute --- src/content/dependencies/image.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/content/dependencies/image.js b/src/content/dependencies/image.js index f9cb00bf..bd7898b1 100644 --- a/src/content/dependencies/image.js +++ b/src/content/dependencies/image.js @@ -51,6 +51,7 @@ export default { square: {type: 'boolean', default: false}, id: {type: 'string'}, + class: {type: 'string'}, alt: {type: 'string'}, width: {type: 'number'}, height: {type: 'number'}, @@ -86,6 +87,8 @@ export default { const idOnImg = willLink ? null : slots.id; const idOnLink = willLink ? slots.id : null; + const classOnImg = willLink ? null : slots.class; + const classOnLink = willLink ? slots.class : null; if (!originalSrc) { return prepare( @@ -119,6 +122,7 @@ export default { const imgAttributes = { id: idOnImg, + class: classOnImg, alt: slots.alt, width: slots.width, height: slots.height, @@ -189,6 +193,7 @@ export default { 'box', 'image-link', hide && 'js-hide', + classOnLink, ], href: -- cgit 1.3.0-6-gf8a5