printf '%s\r\n' 'Content-Type: text/html; charset=utf-8' \
"Content-Security-Policy: script-src 'none'" \
''
- { printf '[html
- [head
- [meta name="viewport" content="width=device-width"]
- [link rel="stylesheet" type="text/css" href="%s/cgilite/common.css"]
- [link rel="stylesheet" type="text/css" href="%s/rawnet.css"]
- [title %s]
- ] [body class="%s"
- ' "$_BASE" "$_BASE" "$(HTML "$title")" "$page"
- printf '
- [header
- [form method=POST action="%s/search/"
- [input name=search placeholder="Search"]
- ]
- ]' "$_BASE"
+ { cat <<-EOF
+ [!DOCTYPE HTML]
+ [html [head
+ [meta name="viewport" content="width=device-width"]
+ [link rel="stylesheet" type="text/css" href="$_BASE/cgilite/common.css"]
+ [link rel="stylesheet" type="text/css" href="$_BASE/rawnet.css"]
+ [title . $(HTML "$title")]
+ ] [body class="$page"
+ [header
+ [form method=POST action="$_BASE/search/"
+ [input name=search placeholder="Search"]
+ ]
+ $( [ ! "$USER_ID" ] \
+ && printf '[div #user_login [a href="%s/login/" Login]]' "$_BASE" \
+ || w_user_login
+ )
+ ][main
+ EOF
cat
- printf '] ]'
+ printf ']]]'
} |"$_EXEC/cgilite/html-sh.sed" -u
}