mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-03-25 09:05:47 +00:00
make sure public/_data.json is committed on publish/unpublish
This commit is contained in:
parent
0e3fe1d6c1
commit
cdfb2c96d6
2 changed files with 10 additions and 0 deletions
4
Makefile
4
Makefile
|
|
@ -1,5 +1,9 @@
|
|||
all: compile
|
||||
|
||||
rss:
|
||||
@echo
|
||||
ruby -w ./bin/rss.rb public
|
||||
|
||||
compile:
|
||||
@echo
|
||||
./bin/compile.sh .
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue