Skip to content

Commit

Permalink
Add "Open in Twitter" icon to navbar
Browse files Browse the repository at this point in the history
Fixes #10
  • Loading branch information
zedeus committed Oct 7, 2019
1 parent 5013197 commit 0b7a7c7
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 10 deletions.
15 changes: 8 additions & 7 deletions public/css/fontello.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@font-face {
font-family: 'fontello';
src: url('/fonts/fontello.eot?33844470');
src: url('/fonts/fontello.eot?33844470#iefix') format('embedded-opentype'),
url('/fonts/fontello.woff2?33844470') format('woff2'),
url('/fonts/fontello.woff?33844470') format('woff'),
url('/fonts/fontello.ttf?33844470') format('truetype'),
url('/fonts/fontello.svg?33844470#fontello') format('svg');
src: url('/fonts/fontello.eot?23617755');
src: url('/fonts/fontello.eot?23617755#iefix') format('embedded-opentype'),
url('/fonts/fontello.woff2?23617755') format('woff2'),
url('/fonts/fontello.woff?23617755') format('woff'),
url('/fonts/fontello.ttf?23617755') format('truetype'),
url('/fonts/fontello.svg?23617755#fontello') format('svg');
font-weight: normal;
font-style: normal;
}
Expand Down Expand Up @@ -50,5 +50,6 @@
.icon-search:before { content: '\e80e'; } /* '' */
.icon-pin:before { content: '\e80f'; } /* '' */
.icon-cog:before { content: '\e812'; } /* '' */
.icon-rss-feed:before { content: '\f143'; } /* '' */
.icon-rss-feed:before { content: '\e813'; } /* '' */
.icon-bird:before { content: '\f099'; } /* '' */
.icon-thumbs-up:before { content: '\f164'; } /* '' */
Binary file modified public/fonts/fontello.eot
Binary file not shown.
10 changes: 9 additions & 1 deletion public/fonts/fontello.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/fonts/fontello.ttf
Binary file not shown.
Binary file modified public/fonts/fontello.woff
Binary file not shown.
Binary file modified public/fonts/fontello.woff2
Binary file not shown.
8 changes: 6 additions & 2 deletions src/views/general.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import uri
import uri, strutils
import karax/[karaxdsl, vdom]

import renderutils
Expand All @@ -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"):
Expand All @@ -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"

Expand Down

0 comments on commit 0b7a7c7

Please sign in to comment.