$title$
+$if(subtitle)$ +$subtitle$
+$endif$ +$for(author)$ + +$endfor$ +$if(date)$ +$date$
+$endif$ ++
+ + + + Generated on $now$ using $generator$ +
+diff --git a/build.sh b/build.sh index 5666cb9..48c2bb1 100755 --- a/build.sh +++ b/build.sh @@ -1,24 +1,24 @@ #!/bin/bash -e shopt -s globstar -include_after=$(mktemp "/tmp/$USER.XXXXXXXXXX") tree_output=$(mktemp "/tmp/$USER.XXXXXXXXXX") tree_file=$(mktemp "/tmp/$USER.XXXXXXXXXX") -trap "rm \"$include_after\" \"$tree_output\" \"$tree_file\"" EXIT +trap "rm \"$tree_output\" \"$tree_file\"" EXIT -# Preprocess include-after.html -sed "s/{{ now }}/$(date -Iseconds)/g;s/{{ generator }}/$(pandoc --version | head -n1)/g" include-after.html > "$include_after" +# Variables included in the pandoc template +now="$(date -Iseconds)" +generator="$(pandoc --version | head -n1)" function convert { pandoc \ --read markdown \ --write html \ --standalone \ - --include-in-header include-header.html \ - --include-before-body include-before.html \ - --include-after-body "$include_after" \ + --template template.html \ --highlight-style zenburn \ --css "/~$USER/theme.css" \ + --variable generator="$generator" \ + --variable now="$now" \ -o "$2" \ "$1" chmod 644 "$2" diff --git a/include-after.html b/include-after.html deleted file mode 100644 index 3a4e84b..0000000 --- a/include-after.html +++ /dev/null @@ -1,8 +0,0 @@ -
- - - - Generated on {{ now }} using {{ generator }} -
- diff --git a/include-before.html b/include-before.html deleted file mode 100644 index 9fe2cc7..0000000 --- a/include-before.html +++ /dev/null @@ -1,10 +0,0 @@ - -$subtitle$
+$endif$ +$for(author)$ + +$endfor$ +$if(date)$ +$date$
+$endif$ ++ + + + Generated on $now$ using $generator$ +
+