From 11564d469dc313d732e462cb56314eb5a624e121 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 2 Oct 2024 18:13:44 -0300 Subject: content, css: linkExternal: suffixNormalContent slot --- src/content/dependencies/linkExternal.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/content') diff --git a/src/content/dependencies/linkExternal.js b/src/content/dependencies/linkExternal.js index f6b47db7..073c821e 100644 --- a/src/content/dependencies/linkExternal.js +++ b/src/content/dependencies/linkExternal.js @@ -11,6 +11,11 @@ export default { mutable: false, }, + suffixNormalContent: { + type: 'html', + mutable: false, + }, + style: { // This awkward syntax is because the slot descriptor validator can't // differentiate between a function that returns a validator (the usual @@ -131,6 +136,16 @@ export default { linkAttributes.set('target', '_blank'); } + if (!html.isBlank(slots.suffixNormalContent)) { + linkContent = + html.tags([ + linkContent, + + html.tag('span', {class: 'normal-content'}, + slots.suffixNormalContent), + ], {[html.joinChildren]: ''}); + } + return html.tag('a', linkAttributes, linkContent); }, }; -- cgit 1.3.0-6-gf8a5