From d4318084d64209c26bda6464b25dcd53f7479086 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 19 Dec 2024 12:49:08 -0400 Subject: content: generateAlbumCommentaryPage: stub commentary pages --- .../dependencies/generateAlbumCommentaryPage.js | 26 +++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'src/content/dependencies/generateAlbumCommentaryPage.js') diff --git a/src/content/dependencies/generateAlbumCommentaryPage.js b/src/content/dependencies/generateAlbumCommentaryPage.js index 61d9ca95..e323ed39 100644 --- a/src/content/dependencies/generateAlbumCommentaryPage.js +++ b/src/content/dependencies/generateAlbumCommentaryPage.js @@ -146,14 +146,24 @@ export default { mainClasses: ['long-content'], mainContent: [ html.tag('p', - language.$(pageCapsule, 'infoLine', { - words: - html.tag('b', - language.formatWordCount(data.wordCount, {unit: true})), - - entries: - html.tag('b', - language.countCommentaryEntries(data.entryCount, {unit: true})), + 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 && -- cgit 1.3.0-6-gf8a5