diff options
Diffstat (limited to '_posts/2014-05-31-less-file-compilation-for-jekyll-github-pages.markdown')
-rw-r--r-- | _posts/2014-05-31-less-file-compilation-for-jekyll-github-pages.markdown | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/_posts/2014-05-31-less-file-compilation-for-jekyll-github-pages.markdown b/_posts/2014-05-31-less-file-compilation-for-jekyll-github-pages.markdown index c4d9eb7..3bd3e78 100644 --- a/_posts/2014-05-31-less-file-compilation-for-jekyll-github-pages.markdown +++ b/_posts/2014-05-31-less-file-compilation-for-jekyll-github-pages.markdown @@ -13,6 +13,14 @@ I recently wrote about [migrating my website to GitHub Pages](/writing/migrating Using [Git hooks](http://git-scm.com/book/en/Customizing-Git-Git-Hooks), it’s possible to run a script at certain points during the Git workflow. To take advantage of this in my case, I added a small bash script to `.git/hooks/pre-commit`: -{% gist benburwell/0ef673f6311b5191186e %} +{% highlight shell %} +#!/bin/sh + +export PATH=/usr/local/bin:$PATH +cd /Users/Ben/Documents/Code/benburwell.github.io/assets/less +lessc --clean-css style.less ../css/style.css +cd /Users/Ben/Documents/Code/benburwell.github.io +git add /Users/Ben/Documents/Code/benburwell.github.io/assets/css/style.css +{% endhighlight %} This is a pretty rough script, but it gets the job done for me. For a much more thorough script, see [this article by TJ VanToll](http://tjvantoll.com/2012/07/07/the-ideal-less-workflow-with-git/). |