diff options
Diffstat (limited to 'src/content/dependencies')
-rw-r--r-- | src/content/dependencies/generateCommentarySection.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/content/dependencies/generateCommentarySection.js b/src/content/dependencies/generateCommentarySection.js index c7f6fa6a..39727360 100644 --- a/src/content/dependencies/generateCommentarySection.js +++ b/src/content/dependencies/generateCommentarySection.js @@ -16,12 +16,23 @@ export default { relation('generateCommentaryEntry', entry)), }), - generate: (relations, {html, language}) => + data: (entries) => ({ + firstEntryIsDated: + (entries[0] + ? !!entries[0].date + : null), + }), + + generate: (data, relations, {html, language}) => html.tags([ relations.heading .slots({ - attributes: {id: 'artist-commentary'}, title: language.$('misc.artistCommentary'), + attributes: [ + {id: 'artist-commentary'}, + data.firstEntryIsDated && + {class: 'first-entry-is-dated'}, + ], }), relations.entries, |