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