Get Rss module working with yesod-core 0.7
This commit is contained in:
parent
f6328872c2
commit
76eabc2969
@ -1,4 +1,5 @@
|
|||||||
{-# LANGUAGE QuasiQuotes #-}
|
{-# LANGUAGE QuasiQuotes #-}
|
||||||
|
{-# LANGUAGE CPP #-}
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
--
|
--
|
||||||
-- Module : Yesod.Helpers.RssFeed
|
-- Module : Yesod.Helpers.RssFeed
|
||||||
@ -14,10 +15,14 @@ module Yesod.Helpers.RssFeed
|
|||||||
( RssFeed (..)
|
( RssFeed (..)
|
||||||
, RssFeedEntry (..)
|
, RssFeedEntry (..)
|
||||||
, rssFeed
|
, rssFeed
|
||||||
|
, rssLink
|
||||||
, RepRss (..)
|
, RepRss (..)
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Yesod
|
import Yesod.Handler
|
||||||
|
import Yesod.Content
|
||||||
|
import Yesod.Widget
|
||||||
|
import Text.Hamlet
|
||||||
import System.Locale (defaultTimeLocale)
|
import System.Locale (defaultTimeLocale)
|
||||||
import Data.Time.Clock (UTCTime)
|
import Data.Time.Clock (UTCTime)
|
||||||
import Data.Time.Format (formatTime)
|
import Data.Time.Format (formatTime)
|
||||||
@ -87,3 +92,16 @@ format = formatTime defaultTimeLocale rfc822DateFormat
|
|||||||
-- validate, this one does.
|
-- validate, this one does.
|
||||||
rfc822DateFormat :: String
|
rfc822DateFormat :: String
|
||||||
rfc822DateFormat = "%a, %d %b %Y %H:%M:%S %z"
|
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$
|
||||||
|
|]
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
name: yesod-newsfeed
|
name: yesod-newsfeed
|
||||||
version: 0.7.0.1
|
version: 0.0.0
|
||||||
license: BSD3
|
license: BSD3
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman <michael@snoyman.com>
|
author: Michael Snoyman, Patrick Brisbin
|
||||||
maintainer: Michael Snoyman <michael@snoyman.com>
|
maintainer: Michael Snoyman <michael@snoyman.com>
|
||||||
synopsis: Helper functions and data types for producing Atom feeds.
|
synopsis: Helper functions and data types for producing Atom feeds.
|
||||||
category: Web, Yesod
|
category: Web, Yesod
|
||||||
@ -16,6 +16,7 @@ library
|
|||||||
, yesod-core >= 0.7 && < 0.8
|
, yesod-core >= 0.7 && < 0.8
|
||||||
, time >= 1.1.4 && < 1.3
|
, time >= 1.1.4 && < 1.3
|
||||||
, hamlet >= 0.7 && < 0.8
|
, hamlet >= 0.7 && < 0.8
|
||||||
|
, old-locale >= 1.0 && < 1.1
|
||||||
exposed-modules: Yesod.Helpers.AtomFeed, Yesod.Helpers.RssFeed
|
exposed-modules: Yesod.Helpers.AtomFeed, Yesod.Helpers.RssFeed
|
||||||
ghc-options: -Wall
|
ghc-options: -Wall
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user