Skip to content

Commit dd3ab62

Browse files
committed
content, css: generateAlbumTrackList: track section descriptions
1 parent 6c256d7 commit dd3ab62

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

src/content/dependencies/generateAlbumTrackList.js

+19-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ function getDisplayMode(album) {
3535
}
3636

3737
export default {
38-
contentDependencies: ['generateAlbumTrackListItem', 'generateContentHeading'],
38+
contentDependencies: [
39+
'generateAlbumTrackListItem',
40+
'generateContentHeading',
41+
'transformContent',
42+
],
43+
3944
extraDependencies: ['html', 'language'],
4045

4146
query(album) {
@@ -53,6 +58,10 @@ export default {
5358
album.trackSections.map(() =>
5459
relation('generateContentHeading'));
5560

61+
relations.trackSectionDescriptions =
62+
album.trackSections.map(section =>
63+
relation('transformContent', section.description));
64+
5665
relations.trackSectionItems =
5766
album.trackSections.map(section =>
5867
section.tracks.map(track =>
@@ -132,6 +141,7 @@ export default {
132141
return html.tag('dl', {class: 'album-group-list'},
133142
stitchArrays({
134143
heading: relations.trackSectionHeadings,
144+
description: relations.trackSectionDescriptions,
135145
items: relations.trackSectionItems,
136146

137147
name: data.trackSectionNames,
@@ -140,6 +150,7 @@ export default {
140150
startIndex: data.trackSectionStartIndices,
141151
}).map(({
142152
heading,
153+
description,
143154
items,
144155

145156
name,
@@ -172,12 +183,17 @@ export default {
172183
}),
173184
})),
174185

175-
html.tag('dd',
186+
html.tag('dd', [
187+
html.tag('blockquote',
188+
{[html.onlyIfContent]: true},
189+
description),
190+
176191
html.tag(listTag,
177192
data.hasTrackNumbers &&
178193
{start: startIndex + 1},
179194

180-
slotItems(items))),
195+
slotItems(items)),
196+
]),
181197
]));
182198

183199
case 'tracks':

src/static/css/site.css

+14
Original file line numberDiff line numberDiff line change
@@ -1528,6 +1528,20 @@ ul > li.has-details {
15281528
margin-left: 0;
15291529
}
15301530

1531+
.album-group-list blockquote {
1532+
max-width: 540px;
1533+
margin-bottom: 9px;
1534+
margin-top: 3px;
1535+
}
1536+
1537+
.album-group-list blockquote p:first-child {
1538+
margin-top: 0;
1539+
}
1540+
1541+
.album-group-list blockquote p:last-child {
1542+
margin-bottom: 0;
1543+
}
1544+
15311545
.group-chronology-link {
15321546
font-style: oblique;
15331547
}

0 commit comments

Comments
 (0)