module Panda.View.RSS where -- env import Panda.Helper.Env import Prelude hiding ((.), (/), id) import Panda.Config.Global as Config import Panda.Type.Pager as Pager import Text.RSS -- model import Panda.Model.Post as Post entry_uri x = "/" ++ Post.uid x.urlEncode.split "/".tail.join "/" -- RSS channel_rss_template = [ Language "en-us" ] item_rss_template x = [ Title $ x.Post.title , Description $ x.Post.body.markup.show , Author $ Config.author_email , Link $ x.item_uri , PubDate $ x.Post.date ] item_uri x = URI { uriScheme = "http://" , uriAuthority = Nothing , uriPath = Config.host_name ++ x.entry_uri , uriQuery = "" , uriFragment = "" } rss xs = RSS Config.blog_title (rss_uri Config.host_name) Config.blog_title channel_rss_template (xs.take 20 .map item_rss_template) .rssToXML.showXML