diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2016-07-31 15:39:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-31 15:39:04 +0200 |
commit | 9e41414880718d5f18e4ae771ef21fc9447d1b60 (patch) | |
tree | 63659f9864780c9d50d474cb59c4d18f673c60cb /src/Hakyll/Web/Feed.hs | |
parent | 68e9c7704216f88b73162963c06ef80616ff318a (diff) | |
parent | a31a5654036c8d8b43d24d3d8cef4e342c517a47 (diff) | |
download | hakyll-9e41414880718d5f18e4ae771ef21fc9447d1b60.tar.gz |
Merge pull request #454 from samgd/whitespace-control
Whitespace trimming
Diffstat (limited to 'src/Hakyll/Web/Feed.hs')
-rw-r--r-- | src/Hakyll/Web/Feed.hs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/Hakyll/Web/Feed.hs b/src/Hakyll/Web/Feed.hs index 16b6dc0..f40fa8a 100644 --- a/src/Hakyll/Web/Feed.hs +++ b/src/Hakyll/Web/Feed.hs @@ -24,16 +24,11 @@ module Hakyll.Web.Feed -------------------------------------------------------------------------------- -import Control.Monad ((<=<)) - - --------------------------------------------------------------------------------- import Hakyll.Core.Compiler import Hakyll.Core.Compiler.Internal import Hakyll.Core.Item import Hakyll.Web.Template import Hakyll.Web.Template.Context -import Hakyll.Web.Template.Internal import Hakyll.Web.Template.List @@ -66,17 +61,16 @@ renderFeed :: FilePath -- ^ Feed template -> [Item String] -- ^ Input items -> Compiler (Item String) -- ^ Resulting item renderFeed feedPath itemPath config itemContext items = do - feedTpl <- compilerUnsafeIO $ loadTemplate feedPath - itemTpl <- compilerUnsafeIO $ loadTemplate itemPath + feedTpl <- loadTemplate feedPath + itemTpl <- loadTemplate itemPath body <- makeItem =<< applyTemplateList itemTpl itemContext' items applyTemplate feedTpl feedContext body where -- Auxiliary: load a template from a datafile loadTemplate path = do - file <- getDataFileName path - templ <- readFile file - return $ readTemplateFile file templ + file <- compilerUnsafeIO $ getDataFileName path + unsafeReadTemplateFile file itemContext' = mconcat [ itemContext |