Home
tadd lazy fix for thisPage - mars - superminimal static website framework HTML git clone git://parazyd.org/mars.git DIR Log DIR Files DIR Refs DIR README DIR LICENSE --- DIR commit 2880f2b837f9b1a7ba50d5cd537755374ba487d4 DIR parent f4366a473429137eebc5dfa5dc5d934a76e7430a HTML Author: parazyd <parazyd@dyne.org> Date: Thu, 28 Jul 2016 14:23:45 +0200 add lazy fix for thisPage Diffstat: M README.md | 5 +++-- M mars.sh | 10 ++++++++-- M webtree | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) --- DIR diff --git a/README.md b/README.md t@@ -15,7 +15,8 @@ and specify the correct DESTDIR - the path to your web root): ; make install ``` -mars for markdown depends on `python-markdown`, and for php, well - `php`... +mars is scripted in zsh, for markdown depends on `python-markdown`, and for php, +well - `php`... ## configuration edit the `webtree` file to reflect the directory tree of your website. the file t@@ -68,7 +69,7 @@ of `index.md` the "syntax" to declare your page's title is ``` -##+ this is my page's title +##+TITLE this is my page's title ``` this line will not end up in your final html. DIR diff --git a/mars.sh b/mars.sh t@@ -38,7 +38,7 @@ countdown() { printf "${fg[white]} >>>${reset_color} $watdo in: ${fg[red]} 3 2 1.. ${reset_color}(hit ^C to abort)" && sleep 1 && \ printf "${fg[white]} >> ${reset_color} $watdo in: ${fg[red]} 2 1.. ${reset_color}(hit ^C to abort)" && sleep 1 && \ printf "${fg[white]} > ${reset_color} $watdo in: ${fg[red]} 1. ${reset_color}(hit ^C to abort)" && sleep 1 && \ - printf "${fg[green]} >>>${reset_color} $watdo " + printf "${fg[green]} >>>${reset_color} $watdo " printf "\n===========================================================\n\n" } t@@ -103,7 +103,13 @@ process-page() { [[ -z $postcontent ]] || { for i in $postcontent; do cat $i >> $name.html - done } ;; + done } + + [[ $name == "index" ]] || { + [[ `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 + } || return 0 } ;; *) err "$pageformat is unsupported";; DIR diff --git a/webtree b/webtree t@@ -23,6 +23,7 @@ pageformat=md # tree=( # example/php # ) + tree=( example/markdown ) t@@ -47,5 +48,4 @@ exclude=( # html that is put in order after the content postcontent=(footer.html) - }