Skip to content

Instantly share code, notes, and snippets.

@krizko
Created May 15, 2015 12:38
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 krizko/d035d34e43aebb2f593b to your computer and use it in GitHub Desktop.
Save krizko/d035d34e43aebb2f593b to your computer and use it in GitHub Desktop.
post-recieve git hook - automatic MD convert to HTML via mdown
#!/bin/sh
echo "Fetching MDs and parsing them"
# Go to dest folder
GIT_WORK_TREE=DEST_FOLDER
cd DEST_FOLDER
# Pull & checkout from git
git pull
git checkout -f
# mdown - convert md files to html
mdown --input "DEST_FOLDER/*.md" --output DEST_FOLDER/md-web
echo "Finished"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment