« get me outta code hell

content: cut html.template boilerplate - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateContentHeading.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-06-12 16:35:38 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-06-12 16:35:38 -0300
commit535acb34613b5cf7e22654619f4337b94b70644d (patch)
tree5a713eb4f12eae7e1fe1aa60941709708585db32 /src/content/dependencies/generateContentHeading.js
parent630af0a345f3be6c3e4aa3300ce138e48ed5ae91 (diff)
content: cut html.template boilerplate
Diffstat (limited to 'src/content/dependencies/generateContentHeading.js')
-rw-r--r--src/content/dependencies/generateContentHeading.js34
1 files changed, 13 insertions, 21 deletions
diff --git a/src/content/dependencies/generateContentHeading.js b/src/content/dependencies/generateContentHeading.js
index 1666ef4b..ccaf1076 100644
--- a/src/content/dependencies/generateContentHeading.js
+++ b/src/content/dependencies/generateContentHeading.js
@@ -1,27 +1,19 @@
 export default {
-  extraDependencies: [
-    'html',
-  ],
+  extraDependencies: ['html'],
 
-  generate({html}) {
-    return html.template({
-      annotation: 'generateContentHeading',
+  slots: {
+    title: {type: 'html'},
+    id: {type: 'string'},
+    tag: {type: 'string', default: 'p'},
+  },
 
-      slots: {
-        title: {type: 'html'},
-        id: {type: 'string'},
-        tag: {type: 'string', default: 'p'},
+  generate(slots, {html}) {
+    return html.tag(slots.tag,
+      {
+        class: 'content-heading',
+        id: slots.id,
+        tabindex: '0',
       },
-
-      content(slots) {
-        return html.tag(slots.tag,
-          {
-            class: 'content-heading',
-            id: slots.id,
-            tabindex: '0',
-          },
-          slots.title);
-      },
-    });
+      slots.title);
   }
 }