Add server config file

This commit is contained in:
Zed
2019-07-31 02:15:43 +02:00
parent b10d894a11
commit 6a9d182249
8 changed files with 53 additions and 23 deletions

View File

@@ -2,17 +2,20 @@ import karax/[karaxdsl, vdom]
const doctype = "<!DOCTYPE html>\n"
proc renderMain*(body: VNode; title="Nitter"): string =
proc renderMain*(body: VNode; title="Nitter"; titleText=""): string =
let node = buildHtml(html(lang="en")):
head:
title: text title
if titleText.len > 0:
title: text titleText & " | " & title
else:
title: text title
link(rel="stylesheet", `type`="text/css", href="/style.css")
body:
nav(id="nav", class="nav-bar container"):
tdiv(class="inner-nav"):
tdiv(class="item"):
a(href="/", class="site-name"): text "nitter"
a(href="/", class="site-name"): text title
tdiv(id="content", class="container"):
body
@@ -31,5 +34,5 @@ proc renderError*(error: string): VNode =
tdiv(class="error-panel"):
span: text error
proc showError*(error: string): string =
renderMain(renderError(error), title = "Error | Nitter")
proc showError*(error: string; title: string): string =
renderMain(renderError(error), title=title, titleText="Error")