« get me outta code hell

data-ize various page content calls - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/page/album-commentary.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-01-25 14:51:00 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-01-25 14:51:00 -0400
commit76833c4083648d11780b0bbc9dd4de05479db240 (patch)
treee1832638c5219f244263bc0016de8f503bf64faa /src/page/album-commentary.js
parentcccebf04544d9d80e84a32a905c5c133a46badd4 (diff)
data-ize various page content calls
* page.cover replaces calls to generateCoverLink
* page.main.headingMode replaces calls to
  generateStickyHeadingContainer or html.tag('h1')
* page.main.classes: ['long-content'] replaces hard-
  coded calls to html.tag('div', {class: 'long-content'})
Diffstat (limited to 'src/page/album-commentary.js')
-rw-r--r--src/page/album-commentary.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/page/album-commentary.js b/src/page/album-commentary.js
index 74eee2b..b8daee4 100644
--- a/src/page/album-commentary.js
+++ b/src/page/album-commentary.js
@@ -22,7 +22,6 @@ export function write(album) {
     type: 'page',
     path: ['albumCommentary', album.directory],
     page: ({
-      generateStickyHeadingContainer,
       getAlbumStylesheet,
       getLinkThemeString,
       getThemeString,
@@ -36,13 +35,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})),
@@ -68,7 +64,7 @@ export function write(album) {
               {style: getLinkThemeString(track.color)},
               transformMultiline(track.commentary)),
           ])
-        ]),
+        ],
       },
 
       nav: generateAlbumExtrasPageNav(album, 'commentary', {
@@ -110,20 +106,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},