Skip to content

Instantly share code, notes, and snippets.

@jtratner
Created May 16, 2012 09:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtratner/2708914 to your computer and use it in GitHub Desktop.
Save jtratner/2708914 to your computer and use it in GitHub Desktop.
Create and edit an octopress post from anywhere (and avoid zsh globbing issues)
#!/bin/zsh
# export BLOG="/path/to/your/octopress/install"
# handles globbing weirdness with zsh + use it from anywhere
# use: new-post "This is my exciting new post!!!"
# set the blog variable to your octopress directory
# TODO: fix this so it handles double-titling
function new-post () {
echo "Creating a new_post titled '$1'."
cd $BLOG/
newpost=$(bundle exec rake "new_post[$1]" | awk '{print $4}')
$EDITOR $BLOG/$newpost
}
@chrishough
Copy link

I was not able to get yours to work, however, I did modify it successfully : https://gist.github.com/4464271

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment