-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathantwar.config.js
68 lines (61 loc) · 1.86 KB
/
antwar.config.js
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
const path = require("path");
const pages = require("./data/content/pages");
module.exports = {
template: {
file: path.resolve(__dirname, "templates/page.ejs"),
context: {
helmet: {}
}
},
renderPage: require("./utils/render-page"),
output: "build",
layout: () => require("./layouts/SiteBody").default,
paths: {
// "404.html": page("404", {
// description: "Page was not found",
// title: "Page not found",
// }),
"/": page("page_index.bs"),
speakers: page("speakers.bs"),
schedule: page("schedule.bs"),
workshops: page("workshops.mdx"),
attendees: page("attendees.mdx"),
"attendees/accomodation": page("attendees/accomodation.mdx"),
"attendees/activities": page("attendees/activities.mdx"),
"attendees/food": page("attendees/food.mdx"),
"attendees/internet": page("attendees/internet.mdx"),
"attendees/transport": page("attendees/transport.mdx"),
sponsors: page("sponsors.mdx"),
about: page("about.mdx"),
privacy: page("privacy.mdx"),
imprint: page("imprint.mdx"),
contact: page("contact.mdx"),
cfp: page("cfp.mdx"),
jobs: page("jobs.mdx"),
export: page("data_export.gen"),
"code-of-conduct": page("coc.mdx"),
"terms-of-service": page("terms_of_service.mdx")
}
};
const defaultKeywords = [
"Reason",
"ReasonML",
"Conference",
"ReasonML",
"Conf",
"Vienna",
"Austria"
];
function page(filepath, meta = {}) {
const name = filepath.split(".")[0];
const ret = () => {
const component = require(`./pages/${filepath}`).default;
const data = pages.find(({ id }) => id === name) || {};
component.description = data.description || meta.description || "";
component.title = data.title || meta.title || "";
component.keywords = data.keywords || meta.keywords || defaultKeywords;
return component;
};
ret.name = name;
return ret;
}