diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-06-14 22:10:12 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-06-18 22:56:12 -0300 |
commit | 99261a74b1f3298144d8c5c6d676d63ad27a1299 (patch) | |
tree | 953c14b248dbc1ead549d717369c6d6155d11f19 /src/content/dependencies/generateTrackList.js | |
parent | 53b65bd2cbfb1001194d67f57780e92c6c8c5aaf (diff) |
content: encapsulate everything
Diffstat (limited to 'src/content/dependencies/generateTrackList.js')
-rw-r--r-- | src/content/dependencies/generateTrackList.js | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/content/dependencies/generateTrackList.js b/src/content/dependencies/generateTrackList.js index 4760ff2f..bc3b6035 100644 --- a/src/content/dependencies/generateTrackList.js +++ b/src/content/dependencies/generateTrackList.js @@ -31,14 +31,16 @@ export default { contributionLinks: relations.contributionLinks, }).map(({trackLink, contributionLinks}) => html.tag('li', - (empty(contributionLinks) - ? trackLink - : language.$('trackList.item.withArtists', { - track: trackLink, - by: + language.encapsulate('trackList.item', itemCapsule => + language.encapsulate(itemCapsule, workingCapsule => { + const workingOptions = {track: trackLink}; + + if (!empty(contributionLinks)) { + workingCapsule += '.withArtists'; + workingOptions.by = html.tag('span', {class: 'by'}, html.metatag('chunkwrap', {split: ','}, - language.$('trackList.item.withArtists.by', { + language.$(itemCapsule, 'withArtists.by', { artists: language.formatConjunctionList( contributionLinks.map(link => @@ -46,6 +48,9 @@ export default { showContribution: slots.showContribution, showIcons: slots.showIcons, }))), - }))), - }))))), + }))); + } + + return language.$(workingCapsule, workingOptions); + }))))), }; |