From b542bdb7705684701dffc44ee2beab210c7e4160 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 4 Jun 2023 11:57:53 -0300 Subject: content: generateArtistInfoPage: visit links & context notes --- src/content/dependencies/generateArtistInfoPage.js | 47 ++++++++++++---------- 1 file changed, 26 insertions(+), 21 deletions(-) (limited to 'src/content') diff --git a/src/content/dependencies/generateArtistInfoPage.js b/src/content/dependencies/generateArtistInfoPage.js index cc19a8d0..a624c12c 100644 --- a/src/content/dependencies/generateArtistInfoPage.js +++ b/src/content/dependencies/generateArtistInfoPage.js @@ -14,8 +14,10 @@ export default { 'linkAlbum', 'linkArtist', 'linkArtistGallery', + 'linkExternal', 'linkGroup', 'linkTrack', + 'transformContent', ], extraDependencies: ['html', 'language'], @@ -108,6 +110,18 @@ export default { return groupInfo; }; + if (artist.contextNotes) { + const contextNotes = sections.contextNotes = {}; + contextNotes.content = relation('transformContent', artist.contextNotes); + } + + if (!empty(artist.urls)) { + const visit = sections.visit = {}; + visit.externalLinks = + artist.urls.map(url => + relation('linkExternal', url)); + } + const trackContributionEntries = [ ...artist.tracksAsArtist.map(track => ({ date: track.date, @@ -359,6 +373,18 @@ export default { mainClasses: ['long-content'], mainContent: [ + sec.contextNotes && [ + html.tag('p', language.$('releaseInfo.note')), + html.tag('blockquote', + sec.contextNotes.content), + ], + + sec.visit && + html.tag('p', + language.$('releaseInfo.visitOn', { + links: language.formatDisjunctionList(sec.visit.externalLinks), + })), + sec.tracks && [ sec.tracks.heading .slots({ @@ -522,8 +548,6 @@ export default { export function write(artist, {wikiData}) { const {groupData, wikiInfo} = wikiData; - const {name, urls, contextNotes} = artist; - let flashes, flashListChunks; if (wikiInfo.enableFlashesAndGames) { flashes = sortChronologically(artist.flashesAsContributor.slice()); @@ -653,25 +677,6 @@ export function write(artist, {wikiData}) { headingMode: 'sticky', content: [ - ...html.fragment( - contextNotes && [ - html.tag('p', - language.$('releaseInfo.note')), - - html.tag('blockquote', - transformMultiline(contextNotes)), - - html.tag('hr'), - ]), - - !empty(urls) && - html.tag('p', - language.$('releaseInfo.visitOn', { - links: language.formatDisjunctionList( - urls.map((url) => fancifyURL(url, {language})) - ), - })), - hasGallery && html.tag('p', language.$('artistPage.viewArtGallery', { -- cgit 1.3.0-6-gf8a5