« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateContributionList.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/generateContributionList.js')
-rw-r--r--src/content/dependencies/generateContributionList.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/content/dependencies/generateContributionList.js b/src/content/dependencies/generateContributionList.js
new file mode 100644
index 0000000..6401e65
--- /dev/null
+++ b/src/content/dependencies/generateContributionList.js
@@ -0,0 +1,21 @@
+export default {
+  contentDependencies: ['linkContribution'],
+  extraDependencies: ['html'],
+
+  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({
+              showIcons: true,
+              showContribution: true,
+              preventWrapping: false,
+              iconMode: 'tooltip',
+            })))),
+};