diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-12-29 22:59:20 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-12-30 16:26:36 -0400 |
commit | f400a43640e7106d181d55365a9617c3d12e5891 (patch) | |
tree | 91c7911c2f5e91d4a230f807814930761991d23a /src/content/dependencies/linkContribution.js | |
parent | 25c434a514152fdd02e5405e4de418cd62614c6a (diff) |
content: misc content syntax cleanup, mostly attribute merging
Diffstat (limited to 'src/content/dependencies/linkContribution.js')
-rw-r--r-- | src/content/dependencies/linkContribution.js | 70 |
1 files changed, 34 insertions, 36 deletions
diff --git a/src/content/dependencies/linkContribution.js b/src/content/dependencies/linkContribution.js index 790afa4..578ae03 100644 --- a/src/content/dependencies/linkContribution.js +++ b/src/content/dependencies/linkContribution.js @@ -51,57 +51,55 @@ export default { if (hasExternalIcons && slots.iconMode === 'inline') { parts.push('withExternalLinks'); options.links = - html.tag('span', - { - [html.noEdgeWhitespace]: true, - class: ['icons', 'icons-inline'], - }, + html.tag('span', {class: ['icons', 'icons-inline']}, + {[html.noEdgeWhitespace]: true}, + language.formatUnitList( relations.artistIcons .slice(0, 4) - .map(icon => icon.slot('context', 'artist')))); + .map(icon => + icon.slot({ + context: 'artist', + })))); } - let content = language.formatString(parts.join('.'), options); + let content = language.formatString(...parts, options); if (hasExternalIcons && slots.iconMode === 'tooltip') { content = [ content, - html.tag('span', - { - [html.noEdgeWhitespace]: true, - class: ['icons', 'icons-tooltip'], - inert: true, - }, - html.tag('span', - { - [html.noEdgeWhitespace]: true, - [html.joinChildren]: '', - class: 'icons-tooltip-content', - }, + html.tag('span', {class: ['icons', 'icons-tooltip']}, + {[html.noEdgeWhitespace]: true}, + {inert: true}, + + html.tag('span', {class: 'icons-tooltip-content'}, + {[html.noEdgeWhitespace]: true}, + {[html.joinChildren]: ''}, + relations.artistIcons - .map(icon => icon.slots({context: 'artist', withText: true})))), + .map(icon => + icon.slots({ + context: 'artist', + withText: true, + })))), ]; } if (hasContribution || hasExternalIcons) { content = - html.tag('span', { - [html.noEdgeWhitespace]: true, - [html.joinChildren]: '', - - class: [ - 'contribution', - - hasExternalIcons && - slots.iconMode === 'tooltip' && - 'has-tooltip', - - parts.length > 1 && - slots.preventWrapping && - 'nowrap', - ], - }, content); + html.tag('span', {class: 'contribution'}, + {[html.noEdgeWhitespace]: true}, + {[html.joinChildren]: ''}, + + hasExternalIcons && + slots.iconMode === 'tooltip' && + {class: 'has-tooltip'}, + + parts.length > 1 && + slots.preventWrapping && + {class: 'nowrap'}, + + content); } return content; |