From a80501ac237e9e15b247fb8f0f5dc15dd39f8fc0 Mon Sep 17 00:00:00 2001 From: "Yann Esposito (Yogsototh)" Date: Mon, 15 Apr 2013 17:29:56 +0200 Subject: [PATCH] updated fixed fordepth elements --- boilerplate.html | 16 ++++++++-------- spt | 16 +++++++++++++--- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/boilerplate.html b/boilerplate.html index 92e9c31..cff1144 100644 --- a/boilerplate.html +++ b/boilerplate.html @@ -5,9 +5,9 @@ $title$ - - - + + + @@ -42,10 +42,10 @@ - - - - - + + + + + diff --git a/spt b/spt index d21c845..cfab1e1 100755 --- a/spt +++ b/spt @@ -10,13 +10,23 @@ curdir=$HOME/Sites/static-pandoc-template for fic in $*; do dst="static-pandoc/${fic:r}.html" tmp=${fic:r}.$$.${fic:e} + boil="$curdir/boilerplate.html" + tmpboil="$curdir/tmp.html" { echo "% ${fic:r}" echo "% Yann Esposito" echo "% $(date +'%d %h %Y')" cat $fic } > $tmp - pandoc -s -S --template $curdir/boilerplate.html $tmp > $dst - \rm -f $tmp + if [[ ${fic:h} != '.' ]]; then + reldir=$(print -- ${fic:h} |sed 's#[^/]*#..#g') + else + reldir='.' + fi + print $fic:h : $reldir + perl -pe 's#\$webprefix\$#'$reldir'#g' < $boil > $tmpboil + [[ ! -d ${dst:h} ]] && mkdir -p ${dst:h} + pandoc -s -S --template $tmpboil $tmp > $dst + print $dst + \rm -f $tmp $tmpboil done -print -- "results are in static-pandoc/"