« 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/generateListingSidebar.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/generateListingSidebar.js')
-rw-r--r--src/content/dependencies/generateListingSidebar.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/content/dependencies/generateListingSidebar.js b/src/content/dependencies/generateListingSidebar.js
new file mode 100644
index 0000000..1e5c8bf
--- /dev/null
+++ b/src/content/dependencies/generateListingSidebar.js
@@ -0,0 +1,29 @@
+export default {
+  contentDependencies: [
+    'generateListingIndexList',
+    'generatePageSidebar',
+    'linkListingIndex',
+  ],
+
+  extraDependencies: ['html'],
+
+  relations: (relation, currentListing) => ({
+    sidebar:
+      relation('generatePageSidebar'),
+
+    listingIndexLink:
+      relation('linkListingIndex'),
+
+    listingIndexList:
+      relation('generateListingIndexList', currentListing),
+  }),
+
+  generate: (relations, {html}) =>
+    relations.sidebar.slots({
+      attributes: {class: 'listing-map-sidebar-box'},
+      content: [
+        html.tag('h1', relations.listingIndexLink),
+        relations.listingIndexList.slot('mode', 'sidebar'),
+      ],
+    }),
+};