« get me outta code hell

content: generateAdditionalFilesListChunk: nice capsule - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-06-13 23:39:35 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-18 22:56:12 -0300
commit98ae7f44fb9a2b74ad7cdd25f75babe84fb4fc81 (patch)
treedfb4503850a294fc31a24a9faf7c36507a8e636a /src/content
parentd2a6d2f75fa1d2e6452d4c67574c6a1ea9fabe5e (diff)
content: generateAdditionalFilesListChunk: nice capsule
Diffstat (limited to 'src/content')
-rw-r--r--src/content/dependencies/generateAdditionalFilesListChunk.js63
1 files changed, 27 insertions, 36 deletions
diff --git a/src/content/dependencies/generateAdditionalFilesListChunk.js b/src/content/dependencies/generateAdditionalFilesListChunk.js
index e6a97898..e66560fc 100644
--- a/src/content/dependencies/generateAdditionalFilesListChunk.js
+++ b/src/content/dependencies/generateAdditionalFilesListChunk.js
@@ -17,40 +17,31 @@ export default {
     },
   },
 
-  generate(slots, {html, language}) {
-    const capsule =
-      language.encapsulate('releaseInfo.additionalFiles.entry');
-
-    const summary =
-      html.tag('summary',
-        html.tag('span',
-          language.$(capsule, {
-            title:
-              html.tag('span', {class: 'group-name'},
-                slots.title),
-          })));
-
-    const description =
-      html.tag('li', {class: 'entry-description'},
-        {[html.onlyIfContent]: true},
-        slots.description);
-
-    const items =
-      (html.isBlank(slots.items)
-        ? html.tag('li',
-            language.$(capsule, 'noFilesAvailable'))
-        : slots.items);
-
-    const content =
-      html.tag('ul', [description, items]);
-
-    const details =
-      html.tag('details',
-        html.isBlank(slots.items) &&
-          {open: true},
-
-        [summary, content]);
-
-    return html.tag('li', details);
-  },
+  generate: (slots, {html, language}) =>
+    language.encapsulate('releaseInfo.additionalFiles.entry', capsule =>
+      html.tag('li',
+        html.tag('details',
+          html.isBlank(slots.items) &&
+            {open: true},
+
+          [
+            html.tag('summary',
+              html.tag('span',
+                language.$(capsule, {
+                  title:
+                    html.tag('span', {class: 'group-name'},
+                      slots.title),
+                }))),
+
+            html.tag('ul', [
+              html.tag('li', {class: 'entry-description'},
+                {[html.onlyIfContent]: true},
+                slots.description),
+
+              (html.isBlank(slots.items)
+                ? html.tag('li',
+                    language.$(capsule, 'noFilesAvailable'))
+                : slots.items),
+            ]),
+          ]))),
 };