From dd3ab6268bc13d259e6d5fe38bb326d50291b227 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 31 Jul 2024 09:33:35 -0300 Subject: content, css: generateAlbumTrackList: track section descriptions --- src/content/dependencies/generateAlbumTrackList.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/content/dependencies') 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': -- cgit 1.3.0-6-gf8a5