1
0
mirror of https://github.com/zedeus/nitter.git synced 2025-12-08 04:55:37 -05:00

Add "Open in Twitter" icon to navbar

Fixes #10
This commit is contained in:
Zed
2019-10-07 18:09:56 +02:00
parent 5013197b17
commit 0b7a7c741e
7 changed files with 23 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
import uri
import uri, strutils
import karax/[karaxdsl, vdom]
import renderutils
@@ -9,7 +9,9 @@ import jester
const doctype = "<!DOCTYPE html>\n"
proc renderNavbar*(title, rss: string; req: Request): VNode =
let path = $(parseUri(req.path) ? filterParams(req.params))
var path = $(parseUri(req.path) ? filterParams(req.params))
path = "https://twitter.com" & path.replace("after=", "max_position=")
buildHtml(nav):
tdiv(class="inner-nav"):
tdiv(class="nav-item"):
@@ -21,6 +23,8 @@ proc renderNavbar*(title, rss: string; req: Request): VNode =
icon "search", title="Search", href="/search"
if rss.len > 0:
icon "rss-feed", title="RSS Feed", href=rss
if "/search" notin path:
icon "bird", title="Open in Twitter", href=path
icon "info-circled", title="About", href="/about"
iconReferer "cog", "/settings", path, title="Preferences"