diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-01-30 20:34:33 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-30 20:34:33 -0400 |
commit | e8a6156d2821bfeac9873721918e41485f0f10e4 (patch) | |
tree | 674ada921e7010d3f6f6eeeef7f18e2aea983a55 /src/page/album-commentary.js | |
parent | 5e5ae8defa884984eb8a6d11ac9917bf81fd03d6 (diff) | |
parent | 4bd23453892beb2aab1f96b1c8aada552288db9a (diff) |
Merge pull request #149 from hsmusic/layout-cleanup
Data-ize various page content-generation calls
Diffstat (limited to 'src/page/album-commentary.js')
-rw-r--r-- | src/page/album-commentary.js | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/page/album-commentary.js b/src/page/album-commentary.js index 5ac6cd26..5fd78beb 100644 --- a/src/page/album-commentary.js +++ b/src/page/album-commentary.js @@ -24,7 +24,6 @@ export function write(album) { type: 'page', path: ['albumCommentary', album.directory], page: ({ - generateStickyHeadingContainer, getAlbumStylesheet, getLinkThemeString, getThemeString, @@ -38,13 +37,10 @@ export function write(album) { theme: getThemeString(album.color), main: { - content: html.tag('div', {class: 'long-content'}, [ - generateStickyHeadingContainer({ - title: language.$('albumCommentaryPage.title', { - album: album.name, - }), - }), + classes: ['long-content'], + headingMode: 'sticky', + content: [ html.tag('p', language.$('albumCommentaryPage.infoLine', { words: html.tag('b', language.formatWordCount(words, {unit: true})), @@ -70,7 +66,7 @@ export function write(album) { {style: getLinkThemeString(track.color)}, transformMultiline(track.commentary)), ]) - ]), + ], }, nav: generateAlbumExtrasPageNav(album, 'commentary', { @@ -112,20 +108,24 @@ export function writeTargetless({wikiData}) { title: language.$('commentaryIndex.title'), main: { - content: html.tag('div', {class: 'long-content'}, [ - html.tag('h1', language.$('commentaryIndex.title')), + classes: ['long-content'], + headingMode: 'static', + + content: [ html.tag('p', language.$('commentaryIndex.infoLine', { words: html.tag('b', language.formatWordCount(totalWords, {unit: true})), entries: html.tag('b', language.countCommentaryEntries(totalEntries, {unit: true})), })), + html.tag('p', language.$('commentaryIndex.albumList.title')), + html.tag('ul', data.map(({album, entries, words}) => html.tag('li', language.$('commentaryIndex.albumList.item', { album: link.albumCommentary(album), words: language.formatWordCount(words, {unit: true}), entries: language.countCommentaryEntries(entries.length, {unit: true}), - })))) - ]), + })))), + ], }, nav: {simple: true}, |