Fan Zhen Coder & Teacher

Git Hook结合Hazel自动更新博客

2016-06-18
   

服务器安装jekyll

sudo 安装rvm和ruby 然后 sudo gem install jekyll

服务器配置git hook

参考 Git post-receive hook

设置好后,在笔记本这里 git push deploy master 就能够更新blog

Hazel设置

添加 _posts 目录,添加 New post 规则,如图 规则

脚本如下:

#!/bin/bash
LONG_FILENAME="$1"
cd ~/www.fanzhen.org
git add *
git commit -m 'New blog post:'$(basename $LONG_FILENAME)
git push deploy master

Similar Posts

Comments