Get Rss module working with yesod-core 0.7

This commit is contained in:
Michael Snoyman 2011-01-16 10:36:18 +02:00
parent f6328872c2
commit 76eabc2969
2 changed files with 22 additions and 3 deletions

View File

@ -1,4 +1,5 @@
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE CPP #-}
-------------------------------------------------------------------------------
--
-- Module : Yesod.Helpers.RssFeed
@ -14,10 +15,14 @@ module Yesod.Helpers.RssFeed
( RssFeed (..)
, RssFeedEntry (..)
, rssFeed
, rssLink
, RepRss (..)
) where
import Yesod
import Yesod.Handler
import Yesod.Content
import Yesod.Widget
import Text.Hamlet
import System.Locale (defaultTimeLocale)
import Data.Time.Clock (UTCTime)
import Data.Time.Format (formatTime)
@ -87,3 +92,16 @@ format = formatTime defaultTimeLocale rfc822DateFormat
-- validate, this one does.
rfc822DateFormat :: String
rfc822DateFormat = "%a, %d %b %Y %H:%M:%S %z"
-- | Generates a link tag in the head of a widget.
rssLink :: Route m
-> String -- ^ title
-> GWidget s m ()
rssLink u title = addHamletHead
#if __GLASGOW_HASKELL__ >= 700
[hamlet|
#else
[$hamlet|
#endif
%link!href=@u@!type="application/rss+xml"!rel="alternate"!title=$title$
|]

View File

@ -1,8 +1,8 @@
name: yesod-newsfeed
version: 0.7.0.1
version: 0.0.0
license: BSD3
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>
author: Michael Snoyman, Patrick Brisbin
maintainer: Michael Snoyman <michael@snoyman.com>
synopsis: Helper functions and data types for producing Atom feeds.
category: Web, Yesod
@ -16,6 +16,7 @@ library
, yesod-core >= 0.7 && < 0.8
, time >= 1.1.4 && < 1.3
, hamlet >= 0.7 && < 0.8
, old-locale >= 1.0 && < 1.1
exposed-modules: Yesod.Helpers.AtomFeed, Yesod.Helpers.RssFeed
ghc-options: -Wall