From 41c22a553d43fbcc04b7a17ec6f83583ed7f3443 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 19 Mar 2023 16:26:55 -0300 Subject: data step: content function updates, relation syntax 2 * new: generateAlbumTrackListItem * new: generateContributionLinks --- src/misc-templates.js | 75 --------------------------------------------------- 1 file changed, 75 deletions(-) (limited to 'src/misc-templates.js') diff --git a/src/misc-templates.js b/src/misc-templates.js index e912c12..3e6948c 100644 --- a/src/misc-templates.js +++ b/src/misc-templates.js @@ -18,10 +18,6 @@ import { sortChronologically, } from './util/wiki-data.js'; -import contentFunction from './util/content-function.js'; - -import u_link from './util/link.js'; - const BANDCAMP_DOMAINS = ['bc.s3m.us', 'music.solatrux.com']; const MASTODON_DOMAINS = ['types.pl']; @@ -80,77 +76,6 @@ function unbound_generateAdditionalFilesList(additionalFiles, { ])); } -// Artist strings - -export const u_generateContributionLinks = contentFunction({ - data: function(contributions, { - showContribution = false, - showIcons = false, - }) { - return { - showContribution, - showIcons, - - contributionData: - contributions.map(({who, what}) => ({ - artistLinkData: u_link.artist.data(who), - - hasContributionPart: !!(showContribution && what), - hasExternalPart: !!(showIcons && !empty(who.urls)), - - artistUrls: who.urls, - contribution: showContribution && what, - })), - }; - }, - - generate: function generateContributionLinks(data, { - html, - iconifyURL, - language, - link, - }) { - return language.formatConjunctionList( - data.contributionData.map(({ - artistLinkData, - hasContributionPart, - hasExternalPart, - artistUrls, - contribution, - }) => { - const artistLink = link.artist(artistLinkData); - - const externalLinks = hasExternalPart && - html.tag('span', - {[html.noEdgeWhitespace]: true, class: 'icons'}, - language.formatUnitList( - artistUrls.map(url => iconifyURL(url, {language})))); - - return ( - (hasContributionPart - ? (hasExternalPart - ? language.$('misc.artistLink.withContribution.withExternalLinks', { - artist: artistLink, - contrib: contribution, - links: externalLinks, - }) - : language.$('misc.artistLink.withContribution', { - artist: artistLink, - contrib: contribution, - })) - : (hasExternalPart - ? language.$('misc.artistLink.withExternalLinks', { - artist: artistLink, - links: externalLinks, - }) - : language.$('misc.artistLink', { - artist: artistLink, - }))) - ); - })); - }, -}); - // Chronology links function unbound_generateChronologyLinks(currentThing, { -- cgit 1.3.0-6-gf8a5