--- /dev/null
+#!/bin/sh
+
+theme_404(){
+ printf "%s\r\n" "Status: 404 Not Found"
+
+ theme_page '/[404]/'
+}
+
+theme_page(){
+ local page="$1" title
+ title="${page%/}"; title="${title##*/}"
+
+ printf "%s\r\n" "Content-Type: text/html; charset=utf-8" ""
+
+ cat <<-EOF
+ <!DOCTYPE HTML>
+ <html><head>
+ <meta name="viewport" content="width=device-width"/>
+ <link rel="stylesheet" type="text/css" href="$_BASE/[wiki]/cgilite/common.css">
+ <title>$(HTML "${title}")</title>
+ </head><body id="$(HTML "$page")">
+ <header></header>
+ <main>$(wiki "$page" || printf 'Page not found')</main>
+ <footer></footer>
+ </body></html>
+ EOF
+}