make sure public/_data.json is committed on publish/unpublish

This commit is contained in:
Sami Samhuri 2015-05-15 20:49:38 -07:00
parent 0e3fe1d6c1
commit cdfb2c96d6
2 changed files with 10 additions and 0 deletions

View file

@ -1,5 +1,9 @@
all: compile
rss:
@echo
ruby -w ./bin/rss.rb public
compile:
@echo
./bin/compile.sh .

View file

@ -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