Created
December 21, 2015 20:58
-
-
Save skoppula/77b3884dc6dec345faca to your computer and use it in GitHub Desktop.
Super simple homebrew templating script to convert HAML and SASS to a *.github.io ready static site.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sass blog.scss blog.css | |
find posts/haml/ -name "*.haml" | while IFS= read -r pathname; do | |
haml_file="$pathname" | |
temp_path=${haml_file%".haml"} | |
html_path=${temp_path/haml/html} | |
echo "Compiling .haml of "${haml_file} | |
haml ${haml_file} ${html_path} | |
done | |
index_file="index.html.haml" | |
new_path=${index_file%".haml"} | |
echo "Compiling .haml for "${index_file} | |
haml ${index_file} ${new_path} | |
# Used for fixing the relative stylesheet link in each of the post files | |
# perl -pi -w -e 's/..\/blog.css/..\/..\/blog.css/g;' *.haml | |
# perl -pi -w -e 's/..\/index.html/..\/..\/index.html/g;' *.haml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment