-# Copyright 2014 Paul Hänsch
+# Copyright 2014 - 2016 Paul Hänsch
#
# This file is part of Serve0
#
cat <<EOF
<!Doctype HTML>
-<html>
- <head>
- <meta name="viewport" content="width=device-width">
- <title>$(. $PAGE title)</title>
- <style type="text/css">
- <!--
- $(. $PAGE css)
- -->
- </style>
- </head>
- <body>
- $(. $PAGE body)
- </body>
-</html>
+<html><head>
+ <meta name="viewport" content="width=device-width">
+ <link rel="stylesheet" href="?static=common.css" />
+ <title>${TITLE:-${PAGE}}</title>
+</head>
EOF
+printf '<body class="%s">' "${PAGE}"
+
+[ -x "${BODY}" ] && . "${BODY}" || printf %s Error
+
+printf '</body></html>'
+
# vi:set filetype=html: