From 1051d317def3c5adef12c45e5cbf863c56d54483 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 19 Dec 2024 13:00:35 -0400 Subject: content: generateAlbumCommentaryPage: album release date --- .../dependencies/generateAlbumCommentaryPage.js | 51 ++++++++++++++-------- src/strings-default.yaml | 1 + 2 files changed, 33 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/content/dependencies/generateAlbumCommentaryPage.js b/src/content/dependencies/generateAlbumCommentaryPage.js index eb07a226..b78fd24e 100644 --- a/src/content/dependencies/generateAlbumCommentaryPage.js +++ b/src/content/dependencies/generateAlbumCommentaryPage.js @@ -97,6 +97,7 @@ export default { data.name = album.name; data.color = album.color; + data.date = album.date; const tracksWithCommentary = album.tracks @@ -150,25 +151,37 @@ export default { mainClasses: ['long-content'], mainContent: [ html.tag('p', - language.encapsulate(pageCapsule, 'infoLine', workingCapsule => { - const workingOptions = {}; - - if (data.entryCount >= 1) { - workingOptions.words = - html.tag('b', - language.formatWordCount(data.wordCount, {unit: true})); - - workingOptions.entries = - html.tag('b', - language.countCommentaryEntries(data.entryCount, {unit: true})); - } - - if (data.entryCount === 0) { - workingCapsule += '.withoutCommentary'; - } - - return language.$(workingCapsule, workingOptions); - })), + {[html.joinChildren]: html.tag('br')}, + + [ + data.date && + data.entryCount >= 1 && + language.$('releaseInfo.albumReleased', { + date: + html.tag('b', + language.formatDate(data.date)), + }), + + language.encapsulate(pageCapsule, 'infoLine', workingCapsule => { + const workingOptions = {}; + + if (data.entryCount >= 1) { + workingOptions.words = + html.tag('b', + language.formatWordCount(data.wordCount, {unit: true})); + + workingOptions.entries = + html.tag('b', + language.countCommentaryEntries(data.entryCount, {unit: true})); + } + + if (data.entryCount === 0) { + workingCapsule += '.withoutCommentary'; + } + + return language.$(workingCapsule, workingOptions); + }) + ]), relations.albumCommentaryEntries && language.encapsulate(pageCapsule, 'entry', entryCapsule => [ diff --git a/src/strings-default.yaml b/src/strings-default.yaml index a3388472..e1e75bb1 100644 --- a/src/strings-default.yaml +++ b/src/strings-default.yaml @@ -260,6 +260,7 @@ releaseInfo: bannerArtBy: "Banner art by {ARTISTS}." released: "Released {DATE}." + albumReleased: "Album released {DATE}." artReleased: "Art released {DATE}." addedToWiki: "Added to wiki {DATE}." -- cgit 1.3.0-6-gf8a5