Browse Source

added sorting to yearly index

master
Sean Clarke 1 year ago
parent
commit
d17d20a9cf
  1. 3
      model/Listing.js

3
model/Listing.js

@ -46,8 +46,9 @@ Listing.prototype.buildIndex = function(){
Listing.prototype.buildIndexforYear = function(year){
var posts = this.forYear(year);
var html = fs.readFileSync(process.cwd() + '/partials/header.html', 'utf8');
var sPosts = posts.sortPostsByUpdated();
html += '<h1>Posts from ' + year + '</h1>\n';
posts.posts.forEach(function(post){
sPosts.forEach(function(post){
html+= post.generateListing();
});
html += fs.readFileSync(process.cwd() + '/partials/footer.html', 'utf8');

Loading…
Cancel
Save