diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-03-20 21:26:39 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-03-20 21:26:50 -0300 |
commit | d35b498ff059643e4686807bda25f7bab5d87ccc (patch) | |
tree | 2d828387f3e8a78c2aece72769ee973afc248792 /src/content | |
parent | 853dd7ea8811b823d4fc4f2fa14fa3ac44b5416f (diff) |
content: linkTemplate: suffixNormalContent here too
Diffstat (limited to 'src/content')
-rw-r--r-- | src/content/dependencies/linkTemplate.js | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/content/dependencies/linkTemplate.js b/src/content/dependencies/linkTemplate.js index 63cc82e8..4f853dc4 100644 --- a/src/content/dependencies/linkTemplate.js +++ b/src/content/dependencies/linkTemplate.js @@ -26,6 +26,11 @@ export default { type: 'html', mutable: false, }, + + suffixNormalContent: { + type: 'html', + mutable: false, + }, }, generate(slots, { @@ -61,13 +66,22 @@ export default { attributes.set('title', slots.tooltip); } - const content = + const mainContent = (html.isBlank(slots.content) ? language.$('misc.missingLinkContent') - : striptags(html.resolve(slots.content, {normalize: 'string'}), { - disallowedTags: new Set(['a']), - })); + : striptags( + html.resolve(slots.content, {normalize: 'string'}), + {disallowedTags: new Set(['a'])})); + + const allContent = + (html.isBlank(slots.suffixNormalContent) + ? mainContent + : html.tags([ + mainContent, + html.tag('span', {class: 'normal-content'}, + slots.suffixNormalContent), + ], {[html.joinChildren]: ''})); - return html.tag('a', attributes, content); + return html.tag('a', attributes, allContent); }, } |