« get me outta code hell

linkGroupDynamically.js « dependencies « content « src - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/linkGroupDynamically.js
blob: 90303ed1c6f5338107cf9683aac2742c9fe4f664 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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),
};