« get me outta code hell

track.js « page « src - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/page/track.js
blob: 94a1e48d37f2ffa5f57fb52900ada8d39f99e1a4 (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
35
36
37
38
39
40
41
42
43
// Track page specification.

import {empty} from '#sugar';

export const description = `per-track info pages`;

export function targets({wikiData}) {
  return wikiData.trackData;
}

export function pathsForTarget(track) {
  return [
    {
      type: 'page',
      path: ['track', track.directory],

      contentFunction: {
        name: 'generateTrackInfoPage',
        args: [track],
      },
    },

    !empty(track.referencedArtworks) && {
      type: 'page',
      path: ['trackReferencedArtworks', track.directory],

      contentFunction: {
        name: 'generateTrackReferencedArtworksPage',
        args: [track],
      },
    },

    !empty(track.referencedByArtworks) && {
      type: 'page',
      path: ['trackReferencingArtworks', track.directory],

      contentFunction: {
        name: 'generateTrackReferencingArtworksPage',
        args: [track],
      },
    },
  ];
}