diff options
Diffstat (limited to 'src/content/dependencies/generateAdditionalNamesBoxItem.js')
-rw-r--r-- | src/content/dependencies/generateAdditionalNamesBoxItem.js | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/src/content/dependencies/generateAdditionalNamesBoxItem.js b/src/content/dependencies/generateAdditionalNamesBoxItem.js index 7515b5b0..e3e59a34 100644 --- a/src/content/dependencies/generateAdditionalNamesBoxItem.js +++ b/src/content/dependencies/generateAdditionalNamesBoxItem.js @@ -1,7 +1,5 @@ -import {stitchArrays} from '#sugar'; - export default { - contentDependencies: ['linkTrack', 'transformContent'], + contentDependencies: ['transformContent'], extraDependencies: ['html', 'language'], relations: (relation, entry) => ({ @@ -12,21 +10,9 @@ export default { (entry.annotation ? relation('transformContent', entry.annotation) : null), - - trackLinks: - (entry.from - ? entry.from.map(track => relation('linkTrack', track)) - : null), - }), - - data: (entry) => ({ - albumNames: - (entry.from - ? entry.from.map(track => track.album.name) - : null), }), - generate: (data, relations, {html, language}) => { + generate: (relations, {html, language}) => { const prefix = 'misc.additionalNames.item'; const itemParts = [prefix]; @@ -42,19 +28,10 @@ export default { if (relations.annotationContent) { accentParts.push('withAnnotation'); accentOptions.annotation = - relations.annotationContent.slot('mode', 'inline'); - } - - if (relations.trackLinks) { - accentParts.push('withAlbums'); - accentOptions.albums = - language.formatConjunctionList( - stitchArrays({ - trackLink: relations.trackLinks, - albumName: data.albumNames, - }).map(({trackLink, albumName}) => - trackLink.slot('content', - language.sanitize(albumName)))); + relations.annotationContent.slots({ + mode: 'inline', + absorbPunctuationFollowingExternalLinks: false, + }); } if (accentParts.length > 2) { |