mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-04-27 14:57:40 +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
|
all: compile
|
||||||
|
|
||||||
|
rss:
|
||||||
|
@echo
|
||||||
|
ruby -w ./bin/rss.rb public
|
||||||
|
|
||||||
compile:
|
compile:
|
||||||
@echo
|
@echo
|
||||||
./bin/compile.sh .
|
./bin/compile.sh .
|
||||||
|
|
|
||||||
|
|
@ -150,6 +150,7 @@ class HarpBlog
|
||||||
if post.draft?
|
if post.draft?
|
||||||
new_post = create_post(post.title, post.body, post.link, {}, {commit: false})
|
new_post = create_post(post.title, post.body, post.link, {}, {commit: false})
|
||||||
delete_post_from_dir('drafts', post.id)
|
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])
|
git_commit("publish '#{quote(post.title)}'", [post_path('drafts'), post_path(new_post.dir), root_data_path])
|
||||||
new_post
|
new_post
|
||||||
else
|
else
|
||||||
|
|
@ -163,6 +164,7 @@ class HarpBlog
|
||||||
else
|
else
|
||||||
new_post = create_post(post.title, post.body, post.link, {draft: true}, {commit: false})
|
new_post = create_post(post.title, post.body, post.link, {draft: true}, {commit: false})
|
||||||
delete_post_from_dir(post.dir, post.id)
|
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])
|
git_commit("unpublish '#{quote(post.title)}'", [post_path(post.dir), post_path('drafts'), root_data_path])
|
||||||
new_post
|
new_post
|
||||||
end
|
end
|
||||||
|
|
@ -454,4 +456,8 @@ class HarpBlog
|
||||||
git_update if origin_updated?
|
git_update if origin_updated?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def build_rss
|
||||||
|
run 'make rss'
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue