« get me outta code hell

generateTrackList.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/generateTrackList.js
blob: 19e2efeb8a3f518b0ba05fec5ff45f12b88c49b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
export default {
  contentDependencies: ['generateTrackListItem'],
  extraDependencies: ['html'],

  relations: (relation, tracks) => ({
    items:
      tracks
        .map(track => relation('generateTrackListItem', track, [])),
  }),

  generate: (relations, {html}) =>
    html.tag('ul',
      {[html.onlyIfContent]: true},

      relations.items.map(item =>
        item.slots({
          showArtists: true,
          showDuration: false,
          color: true,
        }))),
};