« 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: 4928a116b1f77f4e50daf9479aeafd2c68ef8362 (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
// News entry & index page specifications.

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'},
    },
  ];
}