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 @@ -
-

- - Licensed under Creative Commons Attribution 4.0 International - - 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 @@ -
- -

lucidiot's cybrecluster

-
-
diff --git a/include-header.html b/include-header.html deleted file mode 100644 index 22cc7fd..0000000 --- a/include-header.html +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/template.html b/template.html new file mode 100644 index 0000000..befcb60 --- /dev/null +++ b/template.html @@ -0,0 +1,81 @@ + + + + + + +$for(author-meta)$ + +$endfor$ +$if(date-meta)$ + +$endif$ +$if(keywords)$ + +$endif$ + $if(title-prefix)$$title-prefix$ – $endif$$pagetitle$ + +$for(css)$ + +$endfor$ +$if(math)$ + $math$ +$endif$ + + +$for(header-includes)$ + $header-includes$ +$endfor$ + + +
+ +

lucidiot's cybrecluster

+
+
+$for(include-before)$ +$include-before$ +$endfor$ +$if(title)$ +
+

$title$

+$if(subtitle)$ +

$subtitle$

+$endif$ +$for(author)$ +

$author$

+$endfor$ +$if(date)$ +

$date$

+$endif$ +
+$endif$ +$if(toc)$ + +$endif$ +$body$ +$for(include-after)$ +$include-after$ +$endfor$ +
+

+ + Licensed under Creative Commons Attribution 4.0 International + + Generated on $now$ using $generator$ +

+
+ +