Last active
February 23, 2019 23:11
-
-
Save tgdnt/cba70c5fda14fac47eefb9be80677e94 to your computer and use it in GitHub Desktop.
Script to convert Org files into HTML for a Jekyll site
This file contains hidden or 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
| git clean -df | |
| mkdir _posts _drafts | |
| find ./_orgsource -name "*.org" | while read -r filename; do | |
| sed -e 's/\(\#\+BEGIN\_SRC \)\(.*\)/\#\+BEGIN_HTML\ | |
| {\% highlight \2 \%}/' -e 's/\#\+END\_SRC/{\% endhighlight \%}\ | |
| \#\+END_HTML/' $filename > $filename.temp.org | |
| newfilename=$(echo $filename | sed -e "s/\(\.\/\)\(\_orgsource\/\)\(.*\)\(.org\)/\1\3\.html/g") | |
| pandoc -t html -o $newfilename $filename.temp.org | |
| rm $filename.temp.org | |
| done | |
| cp ./_orgsource/images/* ./assets/images/ | |
| bundle exec jekyll $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment