#!/bin/sh
. "$_EXEC/cgilite/file.sh"
+. "$_EXEC/css.sh"
CACHE_AGE=${CACHE_AGE:-300}
export MD_MACROS="$_EXEC/macros"
case "${PATH_INFO}" in
/"[.]"/*)
+ # usually some file related to theme
+ # let file server handle errors
FILE "${_EXEC}/${PATH_INFO#/\[.\]}"
return 0
;;
theme_error 400
return 0
;;
- */\[*\]/*)
+ */\[*\]/*|*/\[*\])
+ # looks like some kind of handler
return 1
;;
*/)
- if [ ! "$(mdfile "$page")" ]; then
+ if [ ! "$(mdfile "$PATH_INFO")" ]; then
theme_error 404
- elif ! acl_read "$page"; then
+ elif ! acl_read "$PATH_INFO"; then
theme_error 403
else
+ PAGE_CSS="$(css "${PATH_INFO}")"
theme_page "${PATH_INFO}"
fi
return 0