Last active
February 23, 2019 23:11
Script to convert Org files into HTML for a Jekyll 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
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