Add RSS button to navbar
This commit is contained in:
		
							parent
							
								
									8912c53f23
								
							
						
					
					
						commit
						6c479ff7ec
					
				
					 9 changed files with 18 additions and 12 deletions
				
			
		
							
								
								
									
										13
									
								
								public/css/fontello.css
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								public/css/fontello.css
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -1,11 +1,11 @@
 | 
			
		|||
@font-face {
 | 
			
		||||
  font-family: 'fontello';
 | 
			
		||||
  src: url('/fonts/fontello.eot?85902121');
 | 
			
		||||
  src: url('/fonts/fontello.eot?85902121#iefix') format('embedded-opentype'),
 | 
			
		||||
       url('/fonts/fontello.woff2?85902121') format('woff2'),
 | 
			
		||||
       url('/fonts/fontello.woff?85902121') format('woff'),
 | 
			
		||||
       url('/fonts/fontello.ttf?85902121') format('truetype'),
 | 
			
		||||
       url('/fonts/fontello.svg?85902121#fontello') format('svg');
 | 
			
		||||
  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');
 | 
			
		||||
  font-weight: normal;
 | 
			
		||||
  font-style: normal;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -50,4 +50,5 @@
 | 
			
		|||
.icon-search:before { content: '\e80e'; } /* '' */
 | 
			
		||||
.icon-pin:before { content: '\e80f'; } /* '' */
 | 
			
		||||
.icon-cog:before { content: '\e812'; } /* '' */
 | 
			
		||||
.icon-rss:before { content: '\f143'; } /* '' */
 | 
			
		||||
.icon-thumbs-up:before { content: '\f164'; } /* '' */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											Binary file not shown.
										
									
								
							| 
						 | 
				
			
			@ -40,6 +40,8 @@
 | 
			
		|||
 | 
			
		||||
<glyph glyph-name="cog" unicode="" d="M0 272l0 156 150 16q14 45 38 88l-96 117 109 109 117-95q41 23 88 37l16 150 156 0 16-150q45-14 88-37l117 95 109-109-96-117q24-43 38-88l150-16 0-156-150-16q-14-47-38-88l96-117-109-109-117 96q-43-24-88-38l-16-150-156 0-16 150q-47 14-88 38l-117-96-109 109 96 117q-24 41-38 88z m355 78q0-60 42-102t103-42 103 42 42 102-42 103-103 42-103-42-42-103z" horiz-adv-x="1000" />
 | 
			
		||||
 | 
			
		||||
<glyph glyph-name="rss-squared" unicode="" d="M286 136q0 29-21 50t-51 21-50-21-21-50 21-51 50-21 51 21 21 51z m196-53q-8 130-99 222t-221 98q-8 1-14-5t-5-13v-71q0-7 5-12t12-6q86-6 147-68t67-147q1-7 6-12t12-5h72q7 0 13 6t5 13z m214 0q-3 86-31 166t-78 145-115 114-145 78-166 31q-7 1-13-5-5-5-5-13v-71q0-7 5-12t12-6q114-4 211-62t156-155 62-211q0-8 5-13t13-5h71q7 0 13 6 6 5 5 13z m161 535v-536q0-66-47-113t-114-48h-535q-67 0-114 48t-47 113v536q0 66 47 113t114 48h535q67 0 114-48t47-113z" horiz-adv-x="857.1" />
 | 
			
		||||
 | 
			
		||||
<glyph glyph-name="thumbs-up" unicode="" d="M143 100q0 15-11 25t-25 11q-15 0-25-11t-11-25q0-15 11-25t25-11q15 0 25 11t11 25z m89 286v-357q0-15-10-25t-26-11h-160q-15 0-25 11t-11 25v357q0 14 11 25t25 10h160q15 0 26-10t10-25z m661 0q0-48-31-83 9-25 9-43 1-42-24-76 9-31 0-66-9-31-31-52 5-62-27-101-36-43-110-44h-72q-37 0-80 9t-68 16-67 22q-69 24-88 25-15 0-25 11t-11 25v357q0 14 10 25t24 11q13 1 42 33t57 67q38 49 56 67 10 10 17 27t10 27 8 34q4 22 7 34t11 29 19 28q10 11 25 11 25 0 46-6t33-15 22-22 14-25 7-28 2-25 1-22q0-21-6-43t-10-33-16-31q-1-4-5-10t-6-13-5-13h155q43 0 75-32t32-75z" horiz-adv-x="928.6" />
 | 
			
		||||
</font>
 | 
			
		||||
</defs>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
		 Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 7.1 KiB  | 
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| 
						 | 
				
			
			@ -39,9 +39,10 @@ proc showSingleTimeline(name, after, agent: string; query: Option[Query];
 | 
			
		|||
  if profile.username.len == 0:
 | 
			
		||||
    return ""
 | 
			
		||||
 | 
			
		||||
  let rssUrl = profile.username & "/rss"
 | 
			
		||||
  let profileHtml = renderProfile(profile, timeline, await railFut, prefs, path)
 | 
			
		||||
  return renderMain(profileHtml, prefs, title, pageTitle(profile),
 | 
			
		||||
                    pageDesc(profile), path)
 | 
			
		||||
                    pageDesc(profile), path, rss=rssUrl)
 | 
			
		||||
 | 
			
		||||
proc showMultiTimeline(names: seq[string]; after, agent: string; query: Option[Query];
 | 
			
		||||
                       prefs: Prefs; path, title: string): Future[string] {.async.} =
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -50,7 +50,7 @@
 | 
			
		|||
        width: 5px;
 | 
			
		||||
        top: 2px;
 | 
			
		||||
        margin-bottom: 0;
 | 
			
		||||
        margin-left: -5px;
 | 
			
		||||
        margin-left: -2.5px;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,7 +5,7 @@ import ../utils, ../types
 | 
			
		|||
 | 
			
		||||
const doctype = "<!DOCTYPE html>\n"
 | 
			
		||||
 | 
			
		||||
proc renderNavbar*(title, path: string): VNode =
 | 
			
		||||
proc renderNavbar*(title, path, rss: string): VNode =
 | 
			
		||||
  buildHtml(nav(id="nav", class="nav-bar container")):
 | 
			
		||||
    tdiv(class="inner-nav"):
 | 
			
		||||
      tdiv(class="item"):
 | 
			
		||||
| 
						 | 
				
			
			@ -14,11 +14,13 @@ proc renderNavbar*(title, path: string): VNode =
 | 
			
		|||
      a(href="/"): img(class="site-logo", src="/logo.png")
 | 
			
		||||
 | 
			
		||||
      tdiv(class="item right"):
 | 
			
		||||
        if rss.len > 0:
 | 
			
		||||
          icon "rss", title="RSS Feed", href=rss
 | 
			
		||||
        icon "info-circled", title="About", href="/about"
 | 
			
		||||
        iconReferer "cog", "/settings", path, title="Preferences"
 | 
			
		||||
 | 
			
		||||
proc renderMain*(body: VNode; prefs: Prefs; title="Nitter"; titleText=""; desc="";
 | 
			
		||||
                 path="/"; `type`="article"; video=""; images: seq[string] = @[]): string =
 | 
			
		||||
proc renderMain*(body: VNode; prefs: Prefs; title="Nitter"; titleText=""; desc=""; path="/";
 | 
			
		||||
                 rss=""; `type`="article"; video=""; images: seq[string] = @[]): string =
 | 
			
		||||
  let node = buildHtml(html(lang="en")):
 | 
			
		||||
    head:
 | 
			
		||||
      link(rel="stylesheet", `type`="text/css", href="/css/style.css")
 | 
			
		||||
| 
						 | 
				
			
			@ -48,7 +50,7 @@ proc renderMain*(body: VNode; prefs: Prefs; title="Nitter"; titleText=""; desc="
 | 
			
		|||
        meta(property="og:video:secure_url", content=video)
 | 
			
		||||
 | 
			
		||||
    body:
 | 
			
		||||
      renderNavbar(title, path)
 | 
			
		||||
      renderNavbar(title, path, rss)
 | 
			
		||||
 | 
			
		||||
      tdiv(id="content", class="container"):
 | 
			
		||||
        body
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue