« get me outta code hell

content: generateWikiHomeAlbumsRow + homepage content - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateWikiHomeContentRow.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-07-26 11:23:49 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-07-26 11:23:49 -0300
commit2d5e22df4b418d96a88afb4589ac326fb77b6e7a (patch)
tree5dcd9ded2e4be484e80e8fc01b9f9617947b5cad /src/content/dependencies/generateWikiHomeContentRow.js
parentbdb4276ffae1c978ec1d1a6e462faf8c117e20a9 (diff)
content: generateWikiHomeAlbumsRow + homepage content
Diffstat (limited to 'src/content/dependencies/generateWikiHomeContentRow.js')
-rw-r--r--src/content/dependencies/generateWikiHomeContentRow.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/content/dependencies/generateWikiHomeContentRow.js b/src/content/dependencies/generateWikiHomeContentRow.js
new file mode 100644
index 0000000..9062280
--- /dev/null
+++ b/src/content/dependencies/generateWikiHomeContentRow.js
@@ -0,0 +1,34 @@
+export default {
+  contentDependencies: ['generateColorStyleVariables'],
+  extraDependencies: ['html'],
+
+  relations(relation, row) {
+    return {
+      colorVariables:
+        relation('generateColorStyleVariables', row.color),
+    };
+  },
+
+  data(row) {
+    return {
+      name: row.name,
+    };
+  },
+
+  slots: {
+    content: {type: 'html'},
+  },
+
+  generate(data, relations, slots, {html}) {
+    return (
+      html.tag('section',
+        {
+          class: 'row',
+          style: [relations.colorVariables],
+        },
+        [
+          html.tag('h2', data.name),
+          slots.content,
+        ]));
+  },
+};