Skip to content
Snippets Groups Projects
Commit b385b052 authored by Bady's avatar Bady
Browse files

Sort events in reverse chronological order

parent 6c5a7e28
Branches
No related merge requests found
id: "0"
name: "GNU/Linux Install Fest - Wayanad"
id: "2017-06-17-00"
name: "GNU/Linux Install Fest and Debian Stretch Release Party - Wayanad"
state: "Kerala"
district: "Wayanad"
venue: "Pazhassi Library, Mananthavady"
lat: ""
lng: ""
locationame: "Pazhassi Library, Mananthavady"
organizedby: "FSUG Wayanadu"
when: "2017-06-17 10:00 AM to 02:00 PM"
lon: ""
organizedby: "FSUG Wayanad"
when: "17-06-2017 10:00 AM to 02:00 PM"
description: "GNU/Linux install fest"
contactinfo: "TBA"
contactinfo: ""
imgurl: "https://wiki.debian.org/ReleasePartyStretch/India/Kerala/Mananthavady?action=AttachFile&do=get&target=wayanadfest.jpeg"
id: "1"
name: "GNU/Linux Install Fest - Calicut"
id: "2017-06-18-00"
name: "GNU/Linux Install Fest and Debian Stretch Release Party - Calicut"
state: "Kerala"
district: "Calicut"
venue: "Parishad Bhavan"
lat: ""
lng: ""
locationame: "Calicut"
lon: ""
organizedby: "FSUG Calicut"
when: "2017-06-18 10:00 AM"
when: "18-06-2017 10:00 AM"
description: "GNU/Linux Install Fest"
contactinfo: ""
imgurl: "https://wiki.debian.org/ReleasePartyStretch/India/Kerala/Kozhikode?action=AttachFile&do=get&target=cltfest.png"
id: "2"
id: "2017-06-24-00"
name: "Debian Stretch Release Party - Kochi"
state: "Kerala"
district: "Ernakulam"
venue: "CUSAT"
lat: ""
lng: ""
locationame: "CUSAT"
lon: ""
organizedby: "FOSSClub, ILUG Cochin and DAKF"
when: "2017-06-24 03:00 PM to 06:00 PM"
when: "24-06-2017 03:00 PM to 06:00 PM"
description: "Debian Stretch Release Party - Kochi"
contactinfo: "TBA"
imgurl: "https://wiki.debian.org/ReleasePartyStretch/India/Kerala/Cochin/CUSAT?action=AttachFile&do=get&target=cochin_cufest.jpeg"
id: "3"
name: "Debian Stretch Release Party - Thrissur"
id: "2017-07-05-00"
name: "GNU/Linux Install Fest and Debian Stretch Release Party - Thrissur"
state: "Kerala"
district: "Thrissur"
venue: "St.Mary's College"
lat: ""
lng: ""
locationame: "St.Mary's College"
lon: ""
organizedby: "FSUG Thrissur, ICFOSS and KSSP"
when: "2017-07-05 09:30 AM to 12:30 PM"
when: "05-07-2017 09:30 AM to 12:30 PM"
description: "Debian Stretch Release Party along with GNU/Linux Install Fest - Thrissur"
contactinfo: "Riot room #fsugtcr:matrix.org"
imgurl: "https://wiki.debian.org/ReleasePartyStretch/India/Kerala/Thrissur?action=AttachFile&do=get&target=fsug_thrissur_debian_stretch_release_party_poster.png"
version: "1.0"
events: !!inc/dir [ 'details' , { ignoreTopLevelDir: true, ignoreIndicator: '-', excludeTopLevelDirSeparator: true } ]
......@@ -10,10 +10,13 @@ var uglify = require('gulp-uglify');
var connect = require('gulp-connect');
var connectProxy = require('gulp-connect-proxy');
var yamlinc = require("gulp-yaml-include");
var yamlinc = require('gulp-yaml-include');
var runSequence = require('run-sequence');
var readYaml = require('read-yaml');
var glob = require("glob");
var glob = require('glob');
var yaml = require('gulp-yaml');
var sortJSON = require('gulp-json-sort').default;
gulp.task('assetscopy', function() {
gulp.src([
......@@ -47,7 +50,7 @@ gulp.task('jslint', function() {
.pipe(jshint.reporter('default'));
});
gulp.task('GenerateIndexPage', function(){
gulp.task('GenerateIndexPage', function() {
gulp.src('pug/pages/*.pug')
.pipe(pug({
pretty: true,
......@@ -58,65 +61,81 @@ gulp.task('GenerateIndexPage', function(){
.pipe(gulp.dest('public'));
});
gulp.task('GenerateEventsYAML', function(){
gulp.task('GenerateEventsYAML', function() {
return gulp.src("events/index.yaml")
.pipe(yamlinc())
.pipe(gulp.dest('public/events'));
.pipe(yamlinc())
.pipe(gulp.dest('public/events'));
});
gulp.task('GenerateEventsJSON', function() {
gulp.src('public/events/index.yaml')
.pipe(yaml())
.pipe(sortJSON({
cmp: function(a, b) {
return a.key < b.key ? 1 : -1;
},
space: 2
}))
.pipe(gulp.dest('public/events'))
});
gulp.task('GenerateEventsPage', function(){
readYaml('public/events/index.yaml', function(err, ydata) {
if (err) throw err;
gulp.src('pug/templates/events.pug')
.pipe(pug({
pretty: true,
data: {
debug: true,
events: ydata
}
}))
.pipe(concat('index' + '.html'))
.pipe(gulp.dest('public/events'));
});
glob("events/details/*.yaml", {}, function (er, files) {
var nooffiles = files.length;
for(var i = 0; i < nooffiles; i++){
readYaml(files[i], function(err, ydata) {
if (err) throw err;
var id = ydata.id;
gulp.src('pug/templates/individual_event_page.pug')
.pipe(pug({
pretty: true,
data: {
debug: true,
evt: ydata
}
}))
.pipe(concat(id + '.html'))
.pipe(gulp.dest('public/events'));
});
gulp.task('GenerateEventsIndex', function() {
var sortedEvents = require('./public/events/index.json');
gulp.src('pug/templates/events.pug')
.pipe(pug({
pretty: true,
data: {
debug: true,
events: sortedEvents
}
});
}))
.pipe(concat('index' + '.html'))
.pipe(gulp.dest('public/events'));
});
gulp.task('GenerateEventPages', function() {
glob("events/details/*.yaml", {}, function(er, files) {
var nooffiles = files.length;
for (var i = 0; i < nooffiles; i++) {
readYaml(files[i], function(err, ydata) {
if (err) throw err;
var id = ydata.id;
gulp.src('pug/templates/individual_event_page.pug')
.pipe(pug({
pretty: true,
data: {
debug: true,
evt: ydata
}
}))
.pipe(concat(id + '.html'))
.pipe(gulp.dest('public/events'));
});
}
});
});
gulp.task('pughtml', function(){
runSequence('GenerateEventsYAML',[
gulp.task('pughtml', function() {
runSequence(
'GenerateIndexPage',
'GenerateEventsPage'
]);
'GenerateEventsYAML',
'GenerateEventsJSON',
'GenerateEventPages',
'GenerateEventsIndex'
)
});
gulp.task('cssmin', function() {
gulp.src([
'node_modules/bootstrap/dist/css/bootstrap.min.css',
//'node_modules/font-awesome/css/font-awesome.min.css',
//'node_modules/normalize.css/normalize.css',
'node_modules/leaflet/dist/leaflet.css',
'node_modules/bootcards/dist/css/bootcards-desktop.min.css',
// 'node_modules/bootcards/dist/css/bootcards-android.min.css',
// 'node_modules/bootcards/dist/css/bootcards-ios.min.css',
'css/*.css'
])
'node_modules/bootstrap/dist/css/bootstrap.min.css',
//'node_modules/font-awesome/css/font-awesome.min.css',
//'node_modules/normalize.css/normalize.css',
'node_modules/leaflet/dist/leaflet.css',
'node_modules/bootcards/dist/css/bootcards-desktop.min.css',
// 'node_modules/bootcards/dist/css/bootcards-android.min.css',
// 'node_modules/bootcards/dist/css/bootcards-ios.min.css',
'css/*.css'
])
.pipe(concat('index.css'))
.pipe(cssmin())
.pipe(gulp.dest('public/css'));
......@@ -124,12 +143,12 @@ gulp.task('cssmin', function() {
gulp.task('jsuglify', function() {
gulp.src([
'node_modules/jquery/dist/jquery.min.js',
'node_modules/bootstrap/dist/js/bootstrap.min.js',
'node_modules/leaflet/dist/leaflet.js',
'node_modules/bootcards/dist/js/bootcards.min.js',
'js/*.js'
])
'node_modules/jquery/dist/jquery.min.js',
'node_modules/bootstrap/dist/js/bootstrap.min.js',
'node_modules/leaflet/dist/leaflet.js',
'node_modules/bootcards/dist/js/bootcards.min.js',
'js/*.js'
])
.pipe(concat('index.js'))
.pipe(uglify())
.pipe(gulp.dest('public/js'));
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment