Skip to content

Instantly share code, notes, and snippets.

@joshwnj
Created April 21, 2017 06:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshwnj/58e3cdac8b7ccf4c41fcff2b3ad3189e to your computer and use it in GitHub Desktop.
Save joshwnj/58e3cdac8b7ccf4c41fcff2b3ad3189e to your computer and use it in GitHub Desktop.
very simple bash script to write a new blog post
#!/bin/bash
YYYY=$(date +%Y)
MM=$(date +%m)
DD=$(date +%d)
DIR=posts/$YYYY/$MM/$DD
FILE="$DIR/$1.md"
mkdir -p $DIR
echo "# $1" > $FILE
$EDITOR $FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment