1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
export default {
contentDependencies: ['linkThing', 'linkTrack'],
extraDependencies: ['language'],
relations: (relation, album) => ({
link:
(album.style === 'single'
? relation('linkTrack', album.tracks[0])
: relation('linkThing', 'localized.album', album)),
}),
data: (album) => ({
style: album.style,
name: album.name,
}),
generate: (data, relations, {language}) =>
(data.style === 'single'
? relations.link.slot('content', language.sanitize(data.name))
: relations.link),
};
|