« 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: beb804f8fa7537a7b0ebeeb9cda289d2fe7809c2 (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
// 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],
        },
      },
  ];
}