Skip to content

Commit

Permalink
Added Jakefile, tabs for JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Heneise committed Feb 26, 2014
1 parent f240729 commit b9f3552
Show file tree
Hide file tree
Showing 5 changed files with 386 additions and 352 deletions.
32 changes: 32 additions & 0 deletions Jakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
fs = require('fs');
bcnjs2013 = require('./contents/2013');
bcnjs2014 = require('./contents/2014');

desc('Monthly talks');
task('copy', [], function () {
console.info('Copying for next month');
var
found = false,
next_event = {};

bcnjs2014.forEach(function (event) {
var event_date = new Date(event.date);
if (event_date >= new Date() && !found) {
next_event = event;
found = true;
}
});

fs.writeFile('./contents/_index/events.json', next_event.talks, function (err) {
console.info('Done. Next event: ' + new Date(next_event.date).toDateString());
complete();
});

}, true);

task('clear', [], function () {
console.info('Cleaning for next month');
fs.writeFile('./contents/_index/events.json', '[{},{}]', function (err) {
complete();
});
}, true);
Loading

0 comments on commit b9f3552

Please sign in to comment.