diff --git a/src/nitter.nim b/src/nitter.nim index 77c079a..9f8fcb7 100644 --- a/src/nitter.nim +++ b/src/nitter.nim @@ -32,6 +32,7 @@ setHmacKey(cfg.hmacKey) setProxyEncoding(cfg.base64Media) setMaxHttpConns(cfg.httpMaxConns) setHttpProxy(cfg.proxy, cfg.proxyAuth) +initAboutPage(cfg.staticDir) waitFor initRedisPool(cfg) stdout.write &"Connected to Redis at {cfg.redisHost}:{cfg.redisPort}\n" diff --git a/src/views/about.nim b/src/views/about.nim index 77f92fa..44dc41b 100644 --- a/src/views/about.nim +++ b/src/views/about.nim @@ -8,16 +8,18 @@ const link = "https://github.com/zedeus/nitter/commit/" & hash version = &"{date}-{hash}" -let about = +var aboutHtml: string + +proc initAboutPage*(dir: string) = try: - readFile("public/md/about.html") + aboutHtml = readFile(&"{dir}/md/about.html") except IOError: - stderr.write "public/md/about.html not found, please run `nimble md`\n" - "

About page is missing



" + stderr.write &"{dir}/about.html not found, please run `nimble md`\n" + aboutHtml = "

About page is missing



" proc renderAbout*(): VNode = buildHtml(tdiv(class="overlay-panel")): - verbatim about + verbatim aboutHtml h2: text "Instance info" p: text "Version "