mars

superminimal static website framework
git clone git://parazyd.org/mars.git
Log | Files | Refs | README | LICENSE

commit 2880f2b837f9b1a7ba50d5cd537755374ba487d4
parent f4366a473429137eebc5dfa5dc5d934a76e7430a
Author: parazyd <parazyd@dyne.org>
Date:   Thu, 28 Jul 2016 14:23:45 +0200

add lazy fix for thisPage

Diffstat:
MREADME.md | 5+++--
Mmars.sh | 10++++++++--
Mwebtree | 2+-
3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md @@ -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 @@ -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. diff --git a/mars.sh b/mars.sh @@ -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" } @@ -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";; diff --git a/webtree b/webtree @@ -23,6 +23,7 @@ pageformat=md # tree=( # example/php # ) + tree=( example/markdown ) @@ -47,5 +48,4 @@ exclude=( # html that is put in order after the content postcontent=(footer.html) - }