« 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: d1cca9140ab48ff11fb43f6d139612c0014952ae (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
      .slot('path', ['media.albumAdditionalFile', data.albumDirectory, data.file])
      .slot('content', data.file);
  },
};