diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-07-31 09:33:35 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-07-31 09:33:35 -0300 |
commit | dd3ab6268bc13d259e6d5fe38bb326d50291b227 (patch) | |
tree | 452d9410050a120039cc1c3a8828feffeb4a1d35 /src/content/dependencies/generateAlbumTrackList.js | |
parent | 6c256d71e923b6301037c843a34f4a893f787b96 (diff) |
content, css: generateAlbumTrackList: track section descriptions
Diffstat (limited to 'src/content/dependencies/generateAlbumTrackList.js')
-rw-r--r-- | src/content/dependencies/generateAlbumTrackList.js | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/content/dependencies/generateAlbumTrackList.js b/src/content/dependencies/generateAlbumTrackList.js index a3435bea..9743c750 100644 --- a/src/content/dependencies/generateAlbumTrackList.js +++ b/src/content/dependencies/generateAlbumTrackList.js @@ -35,7 +35,12 @@ function getDisplayMode(album) { } export default { - contentDependencies: ['generateAlbumTrackListItem', 'generateContentHeading'], + contentDependencies: [ + 'generateAlbumTrackListItem', + 'generateContentHeading', + 'transformContent', + ], + extraDependencies: ['html', 'language'], query(album) { @@ -53,6 +58,10 @@ export default { album.trackSections.map(() => relation('generateContentHeading')); + relations.trackSectionDescriptions = + album.trackSections.map(section => + relation('transformContent', section.description)); + relations.trackSectionItems = album.trackSections.map(section => section.tracks.map(track => @@ -132,6 +141,7 @@ export default { return html.tag('dl', {class: 'album-group-list'}, stitchArrays({ heading: relations.trackSectionHeadings, + description: relations.trackSectionDescriptions, items: relations.trackSectionItems, name: data.trackSectionNames, @@ -140,6 +150,7 @@ export default { startIndex: data.trackSectionStartIndices, }).map(({ heading, + description, items, name, @@ -172,12 +183,17 @@ export default { }), })), - html.tag('dd', + html.tag('dd', [ + html.tag('blockquote', + {[html.onlyIfContent]: true}, + description), + html.tag(listTag, data.hasTrackNumbers && {start: startIndex + 1}, - slotItems(items))), + slotItems(items)), + ]), ])); case 'tracks': |