X-Git-Url: http://git.plutz.net/?p=cgilite;a=blobdiff_plain;f=page.sh;h=5726ed9d8d39d2cf18e32647d3ca18891a3c394f;hp=ef9df2e3def9271c49ec455cf3d251df17ed4e68;hb=3ff1de1d7bf98b5ee3c30a21737a31196bcb6ec3;hpb=75f025e157fe5861e77db4ec8fdd860c7feec1cf diff --git a/page.sh b/page.sh index ef9df2e..5726ed9 100755 --- a/page.sh +++ b/page.sh @@ -19,16 +19,13 @@ printf "Content-Type: text/html;charset=utf-8\n\n" -PAGE="$(printf %s "${_GET[p]}" |egrep '^[a-zA-Z0-9_-]+$')" -PAGE="${_EXEC}/pages/${PAGE}.sh" -[ -x "$PAGE" ] || PAGE="${_EXEC}/pages/error.sh" +[ -z "$PAGE" ] && PAGE="$(printf %s "${_GET[page]}" |egrep '^[a-zA-Z0-9_-]+$')" +[ -x "${_EXEC}/pages/${PAGE}.sh" ] || PAGE="error" -NAVIGATION() { - for each in "${_EXEC}"/pages/*.sh; do - link="$(printf %s "$each" |sed -r "s:^.*/([^/]*)\.sh$:\1:")" - title="$($each title)" - [ -n "$title" ] && printf '%s\n' "?p=$link $title" - done -} +[ -z "$NAVIGATION" ] && NAVIGATION=($(printf %s\\n "${_EXEC}"/pages/*.sh |sed -r 's;^.*/([^/]*)\.sh$;\1;')) -. ${_EXEC}/templates/frame.html.sh +CSS="${_EXEC}/templates/${PAGE}.css.sh" +BODY="${_EXEC}/templates/${PAGE}.html.sh" + +. "${_EXEC}/pages/${PAGE}.sh" +. "${_EXEC}/templates/frame.html.sh"