From 6237460f77a05cfddc34825ed8d018048b8aa623 Mon Sep 17 00:00:00 2001 From: Zed Date: Sun, 15 Sep 2019 12:57:44 +0200 Subject: [PATCH] Fix want-my-rss detection --- README.md | 1 + src/routes/rss.nim | 5 +---- src/views/general.nim | 3 +++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 83cdde5..9e8231b 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Inspired by the [invidio.us](https://github.com/omarroth/invidious) project. - AGPLv3 licensed, no proprietary instances permitted - Dark theme - Lightweight (for [@nim_lang](https://twitter.com/nim_lang), 36KB vs 580KB from twitter.com) +- Native RSS feeds ## Installation diff --git a/src/routes/rss.nim b/src/routes/rss.nim index 958f7b2..bba16fb 100644 --- a/src/routes/rss.nim +++ b/src/routes/rss.nim @@ -3,14 +3,11 @@ import asyncdispatch, strutils import jester import router_utils, timeline -import ".."/[types, utils, cache, agents, search] +import ".."/[cache, agents, search] import ../views/general include "../views/rss.nimf" -export uri -export cache, search, agents - proc showRss*(name: string; query: Option[Query]): Future[string] {.async.} = let (profile, timeline, _) = await fetchSingleTimeline(name, "", getAgent(), query) return renderTimelineRss(timeline.content, profile) diff --git a/src/views/general.nim b/src/views/general.nim index fe5f37f..fcf9626 100644 --- a/src/views/general.nim +++ b/src/views/general.nim @@ -26,6 +26,9 @@ proc renderMain*(body: VNode; prefs: Prefs; title="Nitter"; titleText=""; desc=" link(rel="stylesheet", `type`="text/css", href="/css/style.css") link(rel="stylesheet", `type`="text/css", href="/css/fontello.css") + if rss.len > 0: + link(rel="alternate", `type`="application/rss+xml", href=rss, title="RSS feed") + if prefs.hlsPlayback: script(src="/js/hls.light.min.js") script(src="/js/hlsPlayback.js")