@@ -27,6 +27,16 @@ function Hallway (sites) {
28 // Entries
28 // Entries
30+ function compare( a, b ) {
31+ if ( a.date < b.date ){
34+ if ( a.date > b.date ){
30 this.sortEntries = function () {
40 this.sortEntries = function () {
31 const a = []
41 const a = []
32 for (const id in feeds) {
42 for (const id in feeds) {
@@ -36,7 +46,7 @@ function Hallway (sites) {
36 a.push(entry)
46 a.push(entry)
39− return a
49+ return a.sort( compare );
42 this.templateEntry = function (entry) {
52 this.templateEntry = function (entry) {
@@ -92,7 +102,8 @@ function Hallway (sites) {
92 const lines = feed.split('\n')
102 const lines = feed.split('\n')
93 const entries = []
103 const entries = []
94 for (const id in lines) {
104 for (const id in lines) {
95− const line = lines[id]
105+ const line = lines[id].trim()
106+ if(line === ''){ continue }
96 const date = line.substr(0, 25).trim()
107 const date = line.substr(0, 25).trim()
97 const body = line.substr(26).trim()
108 const body = line.substr(26).trim()
98 entries.push({ date, body, author })
109 entries.push({ date, body, author })