Skip to content

Instantly share code, notes, and snippets.

@marcjenkins
Created September 17, 2013 19:23
Show Gist options
  • Save marcjenkins/6599395 to your computer and use it in GitHub Desktop.
Save marcjenkins/6599395 to your computer and use it in GitHub Desktop.
Quick and dirty bash script for creating new Kirby blog posts with Alfred.
# cd to blog folder
cd ~/Sites/plausiblethought/content/blog/
# count files
COUNT=$(ls | wc -l)
# make folder (e.g. 10-test)
mkdir $COUNT-{query}
# cd to folder created above
cd $COUNT-{query}
# get the date
DATE=`date "+%a, %d %b %Y %X"`
# create post.txt and fill it with blog post structure
echo "Title:
‐‐‐‐
Date: $DATE
‐‐‐‐
Text:
" > post.txt
@marcjenkins
Copy link
Author

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