]> git.plutz.net Git - confetti/blob - page.sh
implemented course section
[confetti] / page.sh
1 #!/bin/zsh
2
3 echo -n "Content-Type: text/html;charset=utf-8\n\n"
4
5 PAGE="$(echo "$_GET[\"page\"]" |egrep '^[a-zA-Z0-9_-]+$')"
6 PAGE="${_EXEC}/pages/${PAGE}.sh"
7 [ -x "$PAGE" ] || PAGE="${_EXEC}/pages/error.sh"
8
9 NAVIGATION() {
10   for each in "${_EXEC}"/pages/*.sh; do
11     link="$(echo "$each" |sed -r "s:^.*/([^/]*)\.sh$:\1:")"
12     title="$($each title)"
13     [ -n "$title" ] && echo "/?page=$link $title"
14   done
15 }
16
17 . ${_EXEC}/templates/frame.html.sh