X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=page.sh;fp=page.sh;h=ef1cf4de8a72a1f45d387027ec93c8b9e26d6e16;hp=0000000000000000000000000000000000000000;hb=9d7c6eae1ee756c1ba53d80e7b134fa1f3a1f0b4;hpb=2a8ceba3e2a32940dafd3305237b4b519ef8781c diff --git a/page.sh b/page.sh new file mode 100755 index 0000000..ef1cf4d --- /dev/null +++ b/page.sh @@ -0,0 +1,19 @@ +#!/bin/zsh + +echo "Content-Type: text/html\n\n" + +PAGE="$(echo "$_GET['page']" |egrep '^[a-zA-Z0-9_-]+$')" +PAGE="${_EXEC}/ifcomponent/page_${PAGE}.sh" +[ -x "$PAGE" ] || PAGE="${_EXEC}/ifcomponent/page_error.sh" + +TITLE=$($PAGE title) + +NAVIGATION() { + for each in "${_EXEC}/ifcomponent"/page_*.sh; do + link="$(echo "$each" |sed -r "s:^.*page_(.*)\.sh$:\1:")" + title="$($each title)" + echo "/?page=$link $title" + done +} + +. ${_EXEC}/ifcomponent/frame.sh