diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-06-12 13:59:23 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-06-12 17:32:57 -0300 |
commit | f2df9fb45cda19976cc8710219876134abc8d7ac (patch) | |
tree | 2cd51a283d80fd3ad3bf0e2251e7d9d9879bc73f | |
parent | dd3052db4b15247e1096e2c6927da9633b24854f (diff) |
content: generateTrackInfoPage: simpler commentary/lyrics layout
-rw-r--r-- | src/content/dependencies/generateTrackInfoPage.js | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/content/dependencies/generateTrackInfoPage.js b/src/content/dependencies/generateTrackInfoPage.js index d78c2703..d44761f6 100644 --- a/src/content/dependencies/generateTrackInfoPage.js +++ b/src/content/dependencies/generateTrackInfoPage.js @@ -122,12 +122,8 @@ export default { // Section: Lyrics - if (track.lyrics) { - const lyrics = sections.lyrics = {}; - - lyrics.content = - relation('transformContent', track.lyrics); - } + relations.lyrics = + relation('transformContent', track.lyrics); // Sections: Sheet music files, MIDI/proejct files, additional files @@ -148,10 +144,8 @@ export default { // Section: Artist commentary - if (track.commentary) { - sections.artistCommentary = - relation('generateCommentarySection', track.commentary); - } + relations.artistCommentarySection = + relation('generateCommentarySection', track.commentary); return relations; }, @@ -215,7 +209,7 @@ export default { language.$('releaseInfo.additionalFiles.shortcut.link')), }), - sec.artistCommentary && + !html.isBlank(relations.artistCommentarySection) && language.$('releaseInfo.readCommentary', { link: html.tag('a', {href: '#artist-commentary'}, @@ -334,7 +328,7 @@ export default { relations.flashesThatFeatureList, ]), - sec.lyrics && [ + html.tags([ relations.contentHeading.clone() .slots({ attributes: {id: 'lyrics'}, @@ -342,9 +336,9 @@ export default { }), html.tag('blockquote', - sec.lyrics.content - .slot('mode', 'lyrics')), - ], + {[html.onlyIfContent]: true}, + relations.lyrics.slot('mode', 'lyrics')), + ]), html.tags([ relations.contentHeading.clone() @@ -376,7 +370,7 @@ export default { relations.additionalFilesList, ]), - sec.artistCommentary, + relations.artistCommentarySection, ], navLinkStyle: 'hierarchical', |