« get me outta code hell

content: misc content syntax cleanup, mostly attribute merging - 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:
author(quasar) nebula <qznebula@protonmail.com>2023-12-29 22:59:20 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-12-30 16:26:36 -0400
commitf400a43640e7106d181d55365a9617c3d12e5891 (patch)
tree91c7911c2f5e91d4a230f807814930761991d23a /src/content/dependencies/generateStickyHeadingContainer.js
parent25c434a514152fdd02e5405e4de418cd62614c6a (diff)
content: misc content syntax cleanup, mostly attribute merging
Diffstat (limited to 'src/content/dependencies/generateStickyHeadingContainer.js')
-rw-r--r--src/content/dependencies/generateStickyHeadingContainer.js18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/content/dependencies/generateStickyHeadingContainer.js b/src/content/dependencies/generateStickyHeadingContainer.js
index 5ea10765..8eb39e6c 100644
--- a/src/content/dependencies/generateStickyHeadingContainer.js
+++ b/src/content/dependencies/generateStickyHeadingContainer.js
@@ -6,21 +6,16 @@ export default {
     cover: {type: 'html'},
   },
 
-  generate(slots, {html}) {
-    const hasCover = !html.isBlank(slots.cover);
+  generate: (slots, {html}) =>
+    html.tag('div', {class: 'content-sticky-heading-container'},
+      !html.isBlank(slots.cover) &&
+        {class: 'has-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),
 
-          hasCover &&
+          !html.isBlank(slots.cover) &&
             html.tag('div', {class: 'content-sticky-heading-cover-container'},
               html.tag('div', {class: 'content-sticky-heading-cover'},
                 slots.cover.slot('mode', 'thumbnail'))),
@@ -28,6 +23,5 @@ export default {
 
         html.tag('div', {class: 'content-sticky-subheading-row'},
           html.tag('h2', {class: 'content-sticky-subheading'})),
-      ]);
-  },
+      ]),
 };