« get me outta code hell

linkArtTagDynamically.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/linkArtTagDynamically.js
blob: 964258e135d10f815d48d3a98841b06bd75eb1f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
export default {
  contentDependencies: ['linkArtTagGallery', 'linkArtTagInfo'],
  extraDependencies: ['pagePath'],

  relations: (relation, artTag) => ({
    galleryLink: relation('linkArtTagGallery', artTag),
    infoLink: relation('linkArtTagInfo', artTag),
  }),

  generate: (relations, {pagePath}) =>
    (pagePath[0] === 'artTagInfo'
      ? relations.infoLink
      : relations.galleryLink),
};