diff options
author | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2015-11-14 13:51:55 -0500 |
---|---|---|
committer | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2015-11-14 13:51:55 -0500 |
commit | 646748359a60dc9a71fa67c21e6ce1d4cacf9dce (patch) | |
tree | fa1af5188fe3fc3f0dbdfd392c667ba3fb956826 /publish.sh |
Initial import.
Diffstat (limited to 'publish.sh')
-rwxr-xr-x | publish.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/publish.sh b/publish.sh new file mode 100755 index 0000000..674403d --- /dev/null +++ b/publish.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -x + +(cd input && git pull) + +INPUTS=$(find input -name '*.org' -exec grep -l "#+PUBLISH" {} \;) +readonly filter='s/#\+PUBLISH//g; ;s/\[([^\]]*)\.org\]/[$1.html]/g' + +mkdir -p www +cp static/*.css www + +for input in ${INPUTS}; do + output="www${input#input}" + output="${output%org}html" + mkdir -p $(dirname "$output") + perl -pe "$filter" "$input" | pandoc -f org -s -t html5 -H static/header-ext.html -o "$output" +done |