Created
November 23, 2016 07:43
-
-
Save wtsnjp/b90eef5df96c87d7172a96b6408d7d63 to your computer and use it in GitHub Desktop.
This file contains 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
# Functions for Hugo | |
local BLOG_PATH=~/repos/blog.wtsnjp.com | |
function hg-new() { | |
cd $BLOG_PATH | |
hugo new post/$1.md --editor="macdown" | |
} | |
function hg-preview() { | |
cd $BLOG_PATH | |
open "/Applications/Google Chrome.app" http://localhost:1313 | |
hugo server -D -w | |
} | |
function hg-publish() { | |
cd $BLOG_PATH | |
hugo undraft content/post/$1.md && hugo | |
cd $BLOG_PATH/public | |
git add -A && git commit -m "publish $1" | |
git push origin gh-pages | |
cd $BLOG_PATH | |
} | |
function hg-update() { | |
cd $BLOG_PATH | |
hugo | |
cd $BLOG_PATH/public | |
git add -A && git commit -m "only update" | |
git push origin gh-pages | |
cd $BLOG_PATH | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment