« get me outta code hell

generateArtistInfoPageFlashesChunkItem.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/generateArtistInfoPageFlashesChunkItem.js
blob: e4908bf9b86e797e5f3eee9495a31fed547f4ea6 (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
25
26
27
28
29
30
31
32
33
34
export default {
  contentDependencies: ['generateArtistInfoPageChunkItem', 'linkFlash'],

  extraDependencies: ['language'],

  relations: (relation, contrib) => ({
    // Flashes and games can list multiple contributors as collaborative
    // credits, but we don't display these on the artist page, since they
    // usually involve many artists crediting a larger team where collaboration
    // isn't as relevant (without more particular details that aren't tracked
    // on the wiki).

    template:
      relation('generateArtistInfoPageChunkItem'),

    flashLink:
      relation('linkFlash', contrib.thing),
  }),

  data: (contrib) => ({
    annotation:
      contrib.annotation,
  }),

  generate: (data, relations, {language}) =>
    relations.template.slots({
      annotation: data.annotation,

      content:
        language.$('artistPage.creditList.entry.flash', {
          flash: relations.flashLink,
        }),
    }),
};