diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-03-08 19:04:53 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-03-08 19:04:53 +0100 |
commit | 64b640f97d00c119ef4ed4c8ccf8e588226bfcad (patch) | |
tree | 94e6d9c4ec3aa852268b4c4046a51bdcc05c4a71 /src/Text/Hakyll/Rss.hs | |
parent | d023eb5bf66bd45c1460c9dd331af409d8294763 (diff) | |
download | hakyll-64b640f97d00c119ef4ed4c8ccf8e588226bfcad.tar.gz |
Added RSS date for items.
Diffstat (limited to 'src/Text/Hakyll/Rss.hs')
-rw-r--r-- | src/Text/Hakyll/Rss.hs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Text/Hakyll/Rss.hs b/src/Text/Hakyll/Rss.hs index 5f1d867..992e965 100644 --- a/src/Text/Hakyll/Rss.hs +++ b/src/Text/Hakyll/Rss.hs @@ -5,12 +5,13 @@ module Text.Hakyll.Rss ( RssConfiguration (..) , renderRss , renderRssWith + , renderRssDate ) where import Control.Arrow ((>>>), second) import Control.Monad.Reader (liftIO) -import Text.Hakyll.Context (ContextManipulation) +import Text.Hakyll.Context (ContextManipulation, renderDate) import Text.Hakyll.Hakyll (Hakyll) import Text.Hakyll.Render (render, renderChain) import Text.Hakyll.Renderables (createListingWith) @@ -72,6 +73,11 @@ renderRssWith :: ContextManipulation -- ^ Manipulation to apply on the items. renderRssWith manipulation configuration renderables = do template <- liftIO $ getDataFileName "templates/rss.xml" itemTemplate <- liftIO $ getDataFileName "templates/rss-item.xml" - let renderRssWith' = createRssWith manipulation configuration + let renderRssWith' = createRssWith manipulation' configuration renderables template itemTemplate renderChain [] renderRssWith' + where + manipulation' = manipulation . renderRssDate + +renderRssDate :: ContextManipulation +renderRssDate = renderDate "timestamp" "%a, %d %b %Y %H:%M:%S %Z" "No date found." |