Add dynamic page title

This commit is contained in:
Zed
2019-06-24 22:40:48 +02:00
parent fb3c8ab5c3
commit 38565e2e1f
4 changed files with 17 additions and 9 deletions

View File

@@ -2,11 +2,11 @@
#import user
#import xmltree
#
#proc renderMain*(body: string): string =
#proc renderMain*(body: string; title="Nitter"): string =
<!DOCTYPE html>
<html>
<head>
<title>Nitter</title>
<title>${xmltree.escape(title)}</title>
<link rel="stylesheet" type="text/css" href="/style.css">
</head>
@@ -46,5 +46,5 @@
#end proc
#
#proc showError*(error: string): string =
${renderMain(renderError(error))}
${renderMain(renderError(error), title="Error | Nitter")}
#end proc