@@ -27,6 +27,16 @@ function Hallway (sites) {
2727
2828 // Entries
2929
30+ function compare( a, b ) {
31+ if ( a.date < b.date ){
32+ return -1;
33+ }
34+ if ( a.date > b.date ){
35+ return 1;
36+ }
37+ return 0;
38+ }
39+
3040 this.sortEntries = function () {
3141 const a = []
3242 for (const id in feeds) {
@@ -36,7 +46,7 @@ function Hallway (sites) {
3646 a.push(entry)
3747 }
3848 }
39− return a
49+ return a.sort( compare );
4050 }
4151
4252 this.templateEntry = function (entry) {
@@ -92,7 +102,8 @@ function Hallway (sites) {
92102 const lines = feed.split('\n')
93103 const entries = []
94104 for (const id in lines) {
95− const line = lines[id]
105+ const line = lines[id].trim()
106+ if(line === ''){ continue }
96107 const date = line.substr(0, 25).trim()
97108 const body = line.substr(26).trim()
98109 entries.push({ date, body, author })