« get me outta code hell

linkOtherReleaseOnArtistInfoPage.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/linkOtherReleaseOnArtistInfoPage.js
blob: d3f7853a05dbbc9b6813a81b2691019bb8c7a6da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
export default {
  contentDependencies: ['generateColorStyleAttribute'],
  extraDependencies: ['html', 'language'],

  relations: (relation, track) => ({
    colorStyle:
      relation('generateColorStyleAttribute', track.album.color),
  }),

  data: (track) => ({
    albumName:
      track.album.name,
  }),

  generate: (data, relations, {html, language}) =>
    html.tag('a',
      {href: '#'},
      relations.colorStyle.slot('context', 'primary-only'),
      language.sanitize(data.albumName)),
};