diff options
Diffstat (limited to 'src/content/dependencies/linkAlbumAdditionalFile.js')
-rw-r--r-- | src/content/dependencies/linkAlbumAdditionalFile.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/content/dependencies/linkAlbumAdditionalFile.js b/src/content/dependencies/linkAlbumAdditionalFile.js new file mode 100644 index 00000000..39e7111e --- /dev/null +++ b/src/content/dependencies/linkAlbumAdditionalFile.js @@ -0,0 +1,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, + }); + }, +}; |