commit 6e868939186341a62a55150f07ce912480e3eb2a parent 2880f2b837f9b1a7ba50d5cd537755374ba487d4 Author: parazyd <parazyd@dyne.org> Date: Thu, 28 Jul 2016 15:34:42 +0200 fix up 2880f2b837f9b1a7ba50d5cd537755374ba487d4 Diffstat:
M | mars.sh | | | 14 | +++++++++----- |
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/mars.sh b/mars.sh @@ -105,12 +105,16 @@ process-page() { cat $i >> $name.html done } - [[ $name == "index" ]] || { - [[ `grep $name.html $name.html` ]] && { + [[ `grep $name.html $name.html` ]] && { + sed -i -e 's/class="thisPage" //' $name.html + sed -i -e 's/href="\/'$name'.html"/class="thisPage" href="\/'$name'.html"/' $name.html + } || { + local dirstr=`basename $PWD` + [[ `grep '"/'$dirstr'/"' $name.html` ]] && { sed -i -e 's/class="thisPage" //' $name.html - sed -i -e 's/href="\/'$name'.html"/class="thisPage" href="\/'$name'.html"/' $name.html - } || return 0 } ;; - + sed -i -e 's/href="\/'$dirstr'\/"/class="thisPage" href="\/'$dirstr'\/"/' $name.html + } || return 0 + } ;; *) err "$pageformat is unsupported";; esac