« get me outta code hell

Merge pull request #149 from hsmusic/layout-cleanup - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/page/artist.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-01-30 20:34:33 -0400
committerGitHub <noreply@github.com>2023-01-30 20:34:33 -0400
commite8a6156d2821bfeac9873721918e41485f0f10e4 (patch)
tree674ada921e7010d3f6f6eeeef7f18e2aea983a55 /src/page/artist.js
parent5e5ae8defa884984eb8a6d11ac9917bf81fd03d6 (diff)
parent4bd23453892beb2aab1f96b1c8aada552288db9a (diff)
Merge pull request #149 from hsmusic/layout-cleanup
Data-ize various page content-generation calls
Diffstat (limited to 'src/page/artist.js')
-rw-r--r--src/page/artist.js28
1 files changed, 9 insertions, 19 deletions
diff --git a/src/page/artist.js b/src/page/artist.js
index af0c7c4..87859c8 100644
--- a/src/page/artist.js
+++ b/src/page/artist.js
@@ -321,9 +321,7 @@ export function write(artist, {wikiData}) {
     path: ['artist', artist.directory],
     page: ({
       fancifyURL,
-      generateCoverLink,
       generateInfoGalleryLinks,
-      generateStickyHeadingContainer,
       getArtistAvatar,
       getArtistString,
       html,
@@ -341,20 +339,15 @@ export function write(artist, {wikiData}) {
       return {
         title: language.$('artistPage.title', {artist: name}),
 
-        main: {
-          content: [
-            artist.hasAvatar &&
-              generateCoverLink({
-                src: getArtistAvatar(artist),
-                alt: language.$('misc.alt.artistAvatar'),
-              }),
+        cover: artist.hasAvatar && {
+          src: getArtistAvatar(artist),
+          alt: language.$('misc.alt.artistAvatar'),
+        },
 
-            generateStickyHeadingContainer({
-              title: language.$('artistPage.title', {
-                artist: name,
-              }),
-            }),
+        main: {
+          headingMode: 'sticky',
 
+          content: [
             ...html.fragment(
               contextNotes && [
                 html.tag('p',
@@ -610,12 +603,9 @@ export function write(artist, {wikiData}) {
 
       main: {
         classes: ['top-index'],
-        content: [
-          html.tag('h1',
-            language.$('artistGalleryPage.title', {
-              artist: name,
-            })),
+        headingMode: 'static',
 
+        content: [
           html.tag('p',
             {class: 'quick-info'},
             language.$('artistGalleryPage.infoLine', {