diff --git a/server/harp_blog.rb b/server/harp_blog.rb index 785ff54..ed57cb5 100644 --- a/server/harp_blog.rb +++ b/server/harp_blog.rb @@ -115,7 +115,7 @@ class HarpBlog else save_post(post) if options[:commit] - git_commit("create post '#{post.title}'", [post_path(post.dir)]) + git_commit("create post '#{post.title}'", [year_index_path(post.year), post_path(post.dir)]) end post end @@ -213,6 +213,10 @@ class HarpBlog path_for('public/_data.json') end + def year_index_path(year) + path_for('public/posts', year, 'index.ejs') + end + def post_path(dir, id = nil) args = ['public/posts', dir] args << "#{id}.md" if id