Skip to content

Commit 7ebd94c

Browse files
committed
[fix] Fixing the antwar voting configuration
1 parent cbf0938 commit 7ebd94c

File tree

1 file changed

+16
-49
lines changed

1 file changed

+16
-49
lines changed

antwar.config.js

Lines changed: 16 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,24 @@ module.exports = {
125125
);
126126
}
127127
),
128+
129+
vote: {
130+
path() {
131+
return require('./components/vote/list.jsx').default
132+
}
133+
},
128134

129-
vote: voteList(
130-
'Voting',
131-
{
132-
index: true,
133-
feedback: true,
134-
moneyDistribution: true,
135+
'vote/feedback': {
136+
path() {
137+
return require('./components/vote/list.jsx').default
135138
}
136-
),
139+
},
140+
141+
'vote/moneyDistribution': {
142+
path() {
143+
return require('./components/vote/list.jsx').default
144+
}
145+
},
137146

138147
organization: {
139148
path() {
@@ -200,45 +209,3 @@ function processPage() {
200209
}
201210
};
202211
}
203-
204-
function voteList(title, lists) {
205-
return {
206-
title: title,
207-
path: function() {
208-
function context(request) {
209-
var name = /^\.\/(.*)\.md$/.exec(request)[1];
210-
return {
211-
name: name,
212-
__content: '' // make antwar happy
213-
};
214-
}
215-
context.keys = function() {
216-
return Object.keys(lists).map(k => './' + k + '.md');
217-
};
218-
return context;
219-
},
220-
processPage: {
221-
url: function(o) {
222-
return 'vote/' + o.file.name;
223-
},
224-
name: function(o) {
225-
return o.file.name;
226-
},
227-
anchors: function(o) {
228-
return [];
229-
},
230-
content: function(o) {
231-
return '';
232-
}
233-
},
234-
layouts: {
235-
index: function() {
236-
return require('./components/vote/list.jsx').default
237-
},
238-
page: function() {
239-
return require('./components/vote/list.jsx').default
240-
}
241-
},
242-
redirects: {} // <from>: <to>
243-
};
244-
}

0 commit comments

Comments
 (0)