« get me outta code hell

linkAlbumAdditionalFile.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/linkAlbumAdditionalFile.js
blob: 39e7111eb93534af051417d2233678f2dae2c439 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
export default {
  contentDependencies: ['linkTemplate'],

  relations(relation) {
    return {
      linkTemplate: relation('linkTemplate'),
    };
  },

  data(album, file) {
    return {
      albumDirectory: album.directory,
      file,
    };
  },

  generate(data, relations) {
    return relations.linkTemplate
      .slots({
        path: ['media.albumAdditionalFile', data.albumDirectory, data.file],
        content: data.file,
      });
  },
};