« get me outta code hell

Merge branch 'album-gallery-nav' into preview - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/linkGroupDynamically.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-10-10 09:38:25 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-10-10 09:38:25 -0300
commitf2381a1ee1e20dea5b23ea9d20c7a85b5b1c1c45 (patch)
tree3c0d11e7bb0bb214cdca3e934e082142ed54f3ae /src/content/dependencies/linkGroupDynamically.js
parentcc4c12ad31be6b6d8432f257e112195179f7eafa (diff)
parent962e6d1777feb69711e33b16d11d322edd1744cd (diff)
Merge branch 'album-gallery-nav' into preview
Diffstat (limited to 'src/content/dependencies/linkGroupDynamically.js')
-rw-r--r--src/content/dependencies/linkGroupDynamically.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/content/dependencies/linkGroupDynamically.js b/src/content/dependencies/linkGroupDynamically.js
new file mode 100644
index 00000000..90303ed1
--- /dev/null
+++ b/src/content/dependencies/linkGroupDynamically.js
@@ -0,0 +1,14 @@
+export default {
+  contentDependencies: ['linkGroupGallery', 'linkGroup'],
+  extraDependencies: ['pagePath'],
+
+  relations: (relation, group) => ({
+    galleryLink: relation('linkGroupGallery', group),
+    infoLink: relation('linkGroup', group),
+  }),
+
+  generate: (relations, {pagePath}) =>
+    (pagePath[0] === 'groupGallery'
+      ? relations.galleryLink
+      : relations.infoLink),
+};