« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/page/tag.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/page/tag.js')
-rw-r--r--src/page/tag.js56
1 files changed, 29 insertions, 27 deletions
diff --git a/src/page/tag.js b/src/page/tag.js
index 38f7e21..faa0df2 100644
--- a/src/page/tag.js
+++ b/src/page/tag.js
@@ -2,12 +2,6 @@
 
 // Art tag page specification.
 
-// Imports
-
-import fixWS from 'fix-whitespace';
-
-// Page exports
-
 export function condition({wikiData}) {
   return wikiData.wikiInfo.enableArtTagUI;
 }
@@ -33,6 +27,7 @@ export function write(tag, {wikiData}) {
       getGridHTML,
       getThemeString,
       getTrackCover,
+      html,
       link,
       language,
     }) => ({
@@ -41,27 +36,34 @@ export function write(tag, {wikiData}) {
 
       main: {
         classes: ['top-index'],
-        content: fixWS`
-                    <h1>${language.$('tagPage.title', {tag: tag.name})}</h1>
-                    <p class="quick-info">${language.$('tagPage.infoLine', {
-                      coverArts: language.countCoverArts(things.length, {
-                        unit: true,
-                      }),
-                    })}</p>
-                    <div class="grid-listing">
-                        ${getGridHTML({
-                          entries,
-                          srcFn: (thing) =>
-                            thing.album
-                              ? getTrackCover(thing)
-                              : getAlbumCover(thing),
-                          linkFn: (thing, opts) =>
-                            thing.album
-                              ? link.track(thing, opts)
-                              : link.album(thing, opts),
-                        })}
-                    </div>
-                `,
+        content: [
+          html.tag('h1',
+            language.$('tagPage.title', {
+              tag: tag.name,
+            })),
+
+          html.tag('p',
+            {class: 'quick-info'},
+            language.$('tagPage.infoLine', {
+              coverArts: language.countCoverArts(things.length, {
+                unit: true,
+              }),
+            })),
+
+          html.tag('div',
+            {class: 'grid-listing'},
+            getGridHTML({
+              entries,
+              srcFn: (thing) =>
+                thing.album
+                  ? getTrackCover(thing)
+                  : getAlbumCover(thing),
+              linkFn: (thing, opts) =>
+                thing.album
+                  ? link.track(thing, opts)
+                  : link.album(thing, opts),
+            })),
+        ],
       },
 
       nav: generateTagNav(tag, {