* 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

@ -42,7 +42,7 @@ blogTemplate :: BlogLang -> Text -> Html -> Html
blogTemplate lang t_append body = H.docTypeHtml $ do --add body
H.head $ do
H.title $ (toHtml $ blogTitle lang t_append)
H.link ! A.rel "alternate" ! A.type_ "application/rss+xml" ! A.title "RSS-Feed" ! A.href "/rss"
H.link ! A.rel "alternate" ! A.type_ "application/rss+xml" ! A.title "RSS-Feed" ! A.href (toValue feedURL)
H.link ! A.rel "stylesheet" ! A.type_ "text/css" ! A.href "/static/blogv312.css" ! A.media "all"
--H.link ! A.rel "stylesheet" ! A.type_ "text/css" ! A.href "/res/blogstyle.css" ! A.media "all"
H.meta ! A.httpEquiv "content-type" ! A.content "text/html;charset=UTF-8"
@ -72,6 +72,7 @@ blogTemplate lang t_append body = H.docTypeHtml $ do --add body
toHtml $ orText lang
H.a ! A.class_ "link" ! A.href (toValue imu) ! A.target "_blank" $ "iMessage"
"."
feedURL = "/" ++ show lang ++ "/rss"
renderEntries :: Bool -> [Entry] -> Text -> Maybe Html -> Html
renderEntries showAll entries topText footerLinks = do