From eedd05e6aa40d050851d877a3be90bc5b17dd5f8 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 18 Feb 2025 17:35:35 -0400 Subject: content: inline generateCommentarySection behavior --- src/content/dependencies/generateFlashInfoPage.js | 39 ++++++++++++++++------- 1 file changed, 27 insertions(+), 12 deletions(-) (limited to 'src/content/dependencies/generateFlashInfoPage.js') diff --git a/src/content/dependencies/generateFlashInfoPage.js b/src/content/dependencies/generateFlashInfoPage.js index 148925fb..350a0fc5 100644 --- a/src/content/dependencies/generateFlashInfoPage.js +++ b/src/content/dependencies/generateFlashInfoPage.js @@ -3,7 +3,7 @@ import {empty} from '#sugar'; export default { contentDependencies: [ 'generateAdditionalNamesBox', - 'generateCommentarySection', + 'generateCommentaryEntry', 'generateContentHeading', 'generateContributionList', 'generateFlashActSidebar', @@ -65,11 +65,13 @@ export default { contributorContributionList: relation('generateContributionList', flash.contributorContribs), - artistCommentarySection: - relation('generateCommentarySection', flash.commentary), + artistCommentaryEntries: + flash.commentary + .map(entry => relation('generateCommentaryEntry', entry)), - creditSourcesSection: - relation('generateCommentarySection', flash.creditSources), + creditSourceEntries: + flash.commentary + .map(entry => relation('generateCommentaryEntry', entry)), }), data: (_query, flash) => ({ @@ -121,7 +123,7 @@ export default { {[html.joinChildren]: html.tag('br')}, language.encapsulate('releaseInfo', capsule => [ - !html.isBlank(relations.artistCommentarySection) && + !html.isBlank(relations.artistCommentaryEntries) && language.encapsulate(capsule, 'readCommentary', capsule => language.$(capsule, { link: @@ -130,7 +132,7 @@ export default { language.$(capsule, 'link')), })), - !html.isBlank(relations.creditSourcesSection) && + !html.isBlank(relations.creditSourceEntries) && language.encapsulate(capsule, 'readCreditSources', capsule => language.$(capsule, { link: @@ -165,12 +167,25 @@ export default { }), ]), - relations.artistCommentarySection, + html.tags([ + relations.contentHeading.clone() + .slots({ + attributes: {id: 'artist-commentary'}, + title: language.$('misc.artistCommentary'), + }), - relations.creditSourcesSection.slots({ - id: 'credit-sources', - title: language.$('misc.creditSources'), - }), + relations.artistCommentaryEntries, + ]), + + html.tags([ + relations.contentHeading.clone() + .slots({ + attributes: {id: 'credit-sources'}, + title: language.$('misc.creditSources'), + }), + + relations.creditSourceEntries, + ]), ], navLinkStyle: 'hierarchical', -- cgit 1.3.0-6-gf8a5