« get me outta code hell

news.js « page « src - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/page/news.js
blob: 194ffdcb75bea03d795e0699887329d0b14c08cf (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
export const description = `per-entry news pages & index`;

export function condition({wikiData}) {
  return wikiData.wikiInfo.enableNews;
}

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

export function pathsForTarget(newsEntry) {
  return [
    {
      type: 'page',
      path: ['newsEntry', newsEntry.directory],
      contentFunction: {
        name: 'generateNewsEntryPage',
        args: [newsEntry],
      },
    },
  ];
}

export function pathsTargetless() {
  return [
    {
      type: 'page',
      path: ['newsIndex'],
      contentFunction: {name: 'generateNewsIndexPage'},
    },
  ];
}