Created
January 31, 2013 12:31
-
-
Save wb14123/4682546 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -lt 1 ] | |
then | |
echo "newpost: You need to specify the post name." | |
exit 1 | |
fi | |
POST_NAME=$1 | |
POST_DATE=`date +%Y-%m-%d` | |
POST_DIR="./jekyll/_posts" | |
FILE_NAME=`echo "$POST_DIR/$POST_DATE-$POST_NAME.markdown" | sed "s/ /-/g"` | |
echo " | |
--- | |
layout: post | |
title: $POST_NAME | |
tags: [] | |
--- | |
" > $FILE_NAME | |
vim -c "set spell" $FILE_NAME | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment