diff --git a/Makefile b/Makefile index a9358f8..7dd9efe 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,9 @@ all: compile +rss: + @echo + ruby -w ./bin/rss.rb public + compile: @echo ./bin/compile.sh . diff --git a/server/harp_blog.rb b/server/harp_blog.rb index 605f17f..785ff54 100644 --- a/server/harp_blog.rb +++ b/server/harp_blog.rb @@ -150,6 +150,7 @@ class HarpBlog if post.draft? new_post = create_post(post.title, post.body, post.link, {}, {commit: false}) delete_post_from_dir('drafts', post.id) + build_rss git_commit("publish '#{quote(post.title)}'", [post_path('drafts'), post_path(new_post.dir), root_data_path]) new_post else @@ -163,6 +164,7 @@ class HarpBlog else new_post = create_post(post.title, post.body, post.link, {draft: true}, {commit: false}) delete_post_from_dir(post.dir, post.id) + build_rss git_commit("unpublish '#{quote(post.title)}'", [post_path(post.dir), post_path('drafts'), root_data_path]) new_post end @@ -454,4 +456,8 @@ class HarpBlog git_update if origin_updated? end + def build_rss + run 'make rss' + end + end