From 535acb34613b5cf7e22654619f4337b94b70644d Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 12 Jun 2023 16:35:38 -0300 Subject: content: cut html.template boilerplate --- .../generateReleaseInfoContributionsLine.js | 40 +++++++++------------- 1 file changed, 17 insertions(+), 23 deletions(-) (limited to 'src/content/dependencies/generateReleaseInfoContributionsLine.js') diff --git a/src/content/dependencies/generateReleaseInfoContributionsLine.js b/src/content/dependencies/generateReleaseInfoContributionsLine.js index 2b342d09..78d3e506 100644 --- a/src/content/dependencies/generateReleaseInfoContributionsLine.js +++ b/src/content/dependencies/generateReleaseInfoContributionsLine.js @@ -18,32 +18,26 @@ export default { }; }, - generate(relations, {html, language}) { - return html.template({ - annotation: `generateReleaseInfoContributionsLine`, + slots: { + stringKey: {type: 'string'}, - slots: { - stringKey: {type: 'string'}, - - showContribution: {type: 'boolean', default: true}, - showIcons: {type: 'boolean', default: true}, - }, + showContribution: {type: 'boolean', default: true}, + showIcons: {type: 'boolean', default: true}, + }, - content(slots) { - if (!relations.contributionLinks) { - return html.blank(); - } + generate(relations, slots, {html, language}) { + if (!relations.contributionLinks) { + return html.blank(); + } - return language.$(slots.stringKey, { - artists: - language.formatConjunctionList( - relations.contributionLinks.map(link => - link.slots({ - showContribution: slots.showContribution, - showIcons: slots.showIcons, - }))), - }); - }, + return language.$(slots.stringKey, { + artists: + language.formatConjunctionList( + relations.contributionLinks.map(link => + link.slots({ + showContribution: slots.showContribution, + showIcons: slots.showIcons, + }))), }); }, }; -- cgit 1.3.0-6-gf8a5