* added RSS.hs: functions to create an RSS feed

* added RSS feed handler
* FromReqURI instance for BlogLang
* fixed RSS-feed link
This commit is contained in:
Vincent Ambo 2012-03-24 00:32:38 +01:00
parent a405e185ba
commit efbec9ff76
5 changed files with 85 additions and 13 deletions

View file

@ -3,8 +3,11 @@
module Locales where
import Data.Data (Data, Typeable)
import Data.Maybe (fromMaybe)
import Data.Text (Text)
import qualified Data.Text as T
import Network.URI
import BlogDB (BlogLang (..))
@ -123,6 +126,18 @@ cTextPlaceholder :: BlogLang -> Text
cTextPlaceholder DE = "Kommentartext hier eingeben :]"
cTextPlaceholder EN = "Enter your comment here :]"
-- RSS Strings
rssTitle :: BlogLang -> String
rssTitle DE = "Tazjins Blog"
rssTitle EN = "Tazjin's Blog"
rssDesc :: BlogLang -> String
rssDesc DE = "Feed zu Tazjins Blog"
rssDesc EN = "Feed for Tazjin's Blog"
rssLink :: BlogLang -> URI
rssLink l = fromMaybe nullURI $ parseURI ("http://tazj.in/" ++ show l)
-- errors
notFoundTitle :: BlogLang -> Text
notFoundTitle DE = "Nicht gefunden"