From f400a43640e7106d181d55365a9617c3d12e5891 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 29 Dec 2023 22:59:20 -0400 Subject: content: misc content syntax cleanup, mostly attribute merging --- src/content/dependencies/linkContribution.js | 70 ++++++++++++++-------------- 1 file changed, 34 insertions(+), 36 deletions(-) (limited to 'src/content/dependencies/linkContribution.js') diff --git a/src/content/dependencies/linkContribution.js b/src/content/dependencies/linkContribution.js index 790afa4f..578ae039 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; -- cgit 1.3.0-6-gf8a5