New navigation bar
This commit is contained in:
parent
64f9af28e0
commit
1a3ba05bc0
3 changed files with 34 additions and 4 deletions
BIN
public/logo.png
Normal file
BIN
public/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
|
@ -193,6 +193,7 @@ nav {
|
|||
padding-right: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-basis: 920px;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
|
@ -204,6 +205,26 @@ nav {
|
|||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.item.right {
|
||||
text-align: right;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.site-logo {
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
}
|
||||
|
||||
.site-about {
|
||||
font-size: 17px;
|
||||
padding-right: 2px;
|
||||
margin-top: -0.75px;
|
||||
}
|
||||
|
||||
.site-settings {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.attachments {
|
||||
margin-top: .35em;
|
||||
display: flex;
|
||||
|
|
|
@ -4,6 +4,18 @@ import ../utils
|
|||
|
||||
const doctype = "<!DOCTYPE html>\n"
|
||||
|
||||
proc renderNavbar*(title: string): VNode =
|
||||
buildHtml(nav(id="nav", class="nav-bar container")):
|
||||
tdiv(class="inner-nav"):
|
||||
tdiv(class="item"):
|
||||
a(class="site-name", href="/"): text title
|
||||
|
||||
a(href="/"): img(class="site-logo", src="/logo.png")
|
||||
|
||||
tdiv(class="item right"):
|
||||
a(class="site-about", href="/about"): text "🛈"
|
||||
a(class="site-settings", href="/settings"): text "⚙"
|
||||
|
||||
proc renderMain*(body: VNode; title="Nitter"; titleText=""; desc="";
|
||||
`type`="article"; video=""; images: seq[string] = @[]): string =
|
||||
let node = buildHtml(html(lang="en")):
|
||||
|
@ -29,10 +41,7 @@ proc renderMain*(body: VNode; title="Nitter"; titleText=""; desc="";
|
|||
meta(property="og:video:secure_url", content=video)
|
||||
|
||||
body:
|
||||
nav(id="nav", class="nav-bar container"):
|
||||
tdiv(class="inner-nav"):
|
||||
tdiv(class="item"):
|
||||
a(href="/", class="site-name"): text title
|
||||
renderNavbar(title)
|
||||
|
||||
tdiv(id="content", class="container"):
|
||||
body
|
||||
|
|
Loading…
Reference in a new issue