« 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/generatePreviousNextLinks.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/generatePreviousNextLinks.js
parent630af0a345f3be6c3e4aa3300ce138e48ed5ae91 (diff)
content: cut html.template boilerplate
Diffstat (limited to 'src/content/dependencies/generatePreviousNextLinks.js')
-rw-r--r--src/content/dependencies/generatePreviousNextLinks.js44
1 files changed, 19 insertions, 25 deletions
diff --git a/src/content/dependencies/generatePreviousNextLinks.js b/src/content/dependencies/generatePreviousNextLinks.js
index 42b2c42..5bdcc3a 100644
--- a/src/content/dependencies/generatePreviousNextLinks.js
+++ b/src/content/dependencies/generatePreviousNextLinks.js
@@ -5,32 +5,26 @@ export default {
 
   extraDependencies: ['html', 'language'],
 
-  generate({html, language}) {
-    return html.template({
-      annotation: `generatePreviousNextLinks`,
-
-      slots: {
-        previousLink: {type: 'html'},
-        nextLink: {type: 'html'},
-      },
+  slots: {
+    previousLink: {type: 'html'},
+    nextLink: {type: 'html'},
+  },
 
-      content(slots) {
-        return [
-          !html.isBlank(slots.previousLink) &&
-            slots.previousLink.slots({
-              tooltip: true,
-              attributes: {id: 'previous-button'},
-              content: language.$('misc.nav.previous'),
-            }),
+  generate(slots, {html, language}) {
+    return html.tags([
+      !html.isBlank(slots.previousLink) &&
+        slots.previousLink.slots({
+          tooltip: true,
+          attributes: {id: 'previous-button'},
+          content: language.$('misc.nav.previous'),
+        }),
 
-          !html.isBlank(slots.nextLink) &&
-            slots.nextLink?.slots({
-              tooltip: true,
-              attributes: {id: 'next-button'},
-              content: language.$('misc.nav.next'),
-            }),
-        ].filter(Boolean);
-      },
-    });
+      !html.isBlank(slots.nextLink) &&
+        slots.nextLink?.slots({
+          tooltip: true,
+          attributes: {id: 'next-button'},
+          content: language.$('misc.nav.next'),
+        }),
+    ]);
   },
 };