« get me outta code hell

linkFlashAct.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/linkFlashAct.js
blob: dcad71e08ef0730d445ae76fab905759100793a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
export default {
  relations: (relation, flashAct) => ({
    link:
      relation('linkThing', 'localized.flashActGallery', flashAct),
  }),

  data: (flashAct) => ({
    name:
      flashAct.name,

    nameHTML:
      flashAct.nameHTML,
  }),

  generate: (data, relations, {html, language}) =>
    relations.link.slot('content',
      html.ifelse([
        html.permit(data.nameHTML),
        language.sanitize(data.name),
      ])),
};