« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateStickyHeadingContainer.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/generateStickyHeadingContainer.js')
-rw-r--r--src/content/dependencies/generateStickyHeadingContainer.js54
1 files changed, 24 insertions, 30 deletions
diff --git a/src/content/dependencies/generateStickyHeadingContainer.js b/src/content/dependencies/generateStickyHeadingContainer.js
index 6602a2a3..e5f7cc5d 100644
--- a/src/content/dependencies/generateStickyHeadingContainer.js
+++ b/src/content/dependencies/generateStickyHeadingContainer.js
@@ -1,39 +1,33 @@
 export default {
   extraDependencies: ['html'],
 
-  generate({html}) {
-    return html.template({
-      annotation: `generateStickyHeadingContainer`,
-
-      slots: {
-        title: {type: 'html'},
-        cover: {type: 'html'},
-      },
+  slots: {
+    title: {type: 'html'},
+    cover: {type: 'html'},
+  },
 
-      content(slots) {
-        const hasCover = !html.isBlank(slots.cover);
+  generate(slots, {html}) {
+    const hasCover = !html.isBlank(slots.cover);
 
-        return html.tag('div',
-          {
-            class: [
-              'content-sticky-heading-container',
-              hasCover && 'has-cover',
-            ],
-          },
-          [
-            html.tag('div', {class: 'content-sticky-heading-row'}, [
-              html.tag('h1', slots.title),
+    return html.tag('div',
+      {
+        class: [
+          'content-sticky-heading-container',
+          hasCover && 'has-cover',
+        ],
+      },
+      [
+        html.tag('div', {class: 'content-sticky-heading-row'}, [
+          html.tag('h1', slots.title),
 
-              hasCover &&
-                html.tag('div', {class: 'content-sticky-heading-cover-container'},
-                  html.tag('div', {class: 'content-sticky-heading-cover'},
-                    slots.cover.slot('displayMode', 'thumbnail'))),
-            ]),
+          hasCover &&
+            html.tag('div', {class: 'content-sticky-heading-cover-container'},
+              html.tag('div', {class: 'content-sticky-heading-cover'},
+                slots.cover.slot('displayMode', 'thumbnail'))),
+        ]),
 
-            html.tag('div', {class: 'content-sticky-subheading-row'},
-              html.tag('h2', {class: 'content-sticky-subheading'})),
-          ]);
-      },
-    });
+        html.tag('div', {class: 'content-sticky-subheading-row'},
+          html.tag('h2', {class: 'content-sticky-subheading'})),
+      ]);
   },
 };