The old to post on Octopress is slow with much code to input, so I
need quickly to post what I want. I searched on Google and the do
have someone catch the same idea~

I mainly referred to
https://codewall.com . However, I’d like to separate the blog_post and publish
processes. So I updated the scripts as below:

1
2
3
4
5
6
7
8
#! /bin/bash
EDITOR=/Applications/Aquamacs.app/Contents/MacOS/Aquamacs
BLOG_DIR=~/Documents/octopress
cd $BLOG_DIR
NEW_POST_PATH=`rake new_post["$*"] | awk '/Creating new post:/ {print $4}'`
echo "Editing blog entry $BLOG_DIR/$NEW_POST_PATH"
sleep 1
$EDITOR $BLOG_DIR/$NEW_POST_PATH

That is for post which is saved as blog_post and chmod +x blog_post .

1
2
3
4
5
6
7
8
9
#! /bin/bash
BLOG_DIR=~/Documents/octopress
cd $BLOG_DIR

rake generate
git add -A
git commit -m"$1"
git push origin source
rake deploy

That is for publish which is also saved as executable script as
above. I moved them to the /usr/local/bin directory, where I can
directly call from terminal by tying their names.

That’s all.