« get me outta code hell

content: generateContributionList: blank if no contributions - 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-12 13:34:53 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-18 22:56:08 -0300
commit447e981001f9ed606f3ccb14a66a5bb7d11fcbf3 (patch)
tree86df0ceca11d5cfcd3969c2c3e69e7e0b2f088e5 /src/content
parent70fe734841a7e95f7d7959f1d74d74abe5a1fd31 (diff)
content: generateContributionList: blank if no contributions
Diffstat (limited to 'src/content')
-rw-r--r--src/content/dependencies/generateContributionList.js19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/content/dependencies/generateContributionList.js b/src/content/dependencies/generateContributionList.js
index 6401e65e..0c4ef87a 100644
--- a/src/content/dependencies/generateContributionList.js
+++ b/src/content/dependencies/generateContributionList.js
@@ -2,17 +2,20 @@ export default {
   contentDependencies: ['linkContribution'],
   extraDependencies: ['html'],
 
-  relations: (relation, contributions) =>
-    ({contributionLinks:
-        contributions
-          .map(contrib => relation('linkContribution', contrib))}),
+  relations: (relation, contributions) => ({
+    contributionLinks:
+      contributions
+        .map(contrib => relation('linkContribution', contrib)),
+  }),
 
   generate: (relations, {html}) =>
     html.tag('ul',
-      relations.contributionLinks.map(contributionLink =>
-        html.tag('li',
-          contributionLink
-            .slots({
+      {[html.onlyIfContent]: true},
+
+      relations.contributionLinks
+        .map(contributionLink =>
+          html.tag('li',
+            contributionLink.slots({
               showIcons: true,
               showContribution: true,
               preventWrapping: false,