Skip to content

Commit

Permalink
Don't crash when non-post files are found in _posts
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Jun 26, 2013
1 parent d87c688 commit dca0744
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions heckle.js
Expand Up @@ -44,6 +44,7 @@ function readPosts(config) {
var posts = [];
fs.readdirSync("_posts/").forEach(function(file) {
var d = file.match(/^(\d{4})-(\d\d?)-(\d\d?)-(.+)\.(md|link)$/);
if (!d) return;
var split = readFrontMatter(fs.readFileSync("_posts/" + file, "utf8"));
var post = split.front;
post.date = new Date(d[1], d[2] - 1, d[3]);
Expand Down

0 comments on commit dca0744

Please sign in to comment.