@@ -18,7 +18,7 @@ module Hakyll.Web.Template.Internal
20--------------------------------------------------------------------------------
20--------------------------------------------------------------------------------
21−import Control.Applicative ((<|>))
21+import Control.Monad (forM)
22import Control.Monad.Except (MonadError (..))
22import Control.Monad.Except (MonadError (..))
23import Data.Binary (Binary)
23import Data.Binary (Binary)
24import Data.List (intercalate)
24import Data.List (intercalate)
@@ -135,13 +135,8 @@ applyTemplate' tes context x = go tes
135 "got StringField for expr " ++ show e
135 "got StringField for expr " ++ show e
136 ListField c xs -> do
136 ListField c xs -> do
137 sep <- maybe (return "") go s
137 sep <- maybe (return "") go s
138− bs <- mapM (applyTemplate' b $ combineContexts context x c) xs
138+ bs <- forM xs $ applyTemplate' b $ c <> bindItem context x
139 return $ intercalate sep bs
139 return $ intercalate sep bs
141− combineContexts :: Context a -> Item a -> Context b -> Context b
142− combineContexts ca ia cb = Context $ \ k' args' ib' ->
143− unContext cb k' args' ib'
144− <|> unContext ca k' args' ia
146 applyElem (Partial e) = do
141 applyElem (Partial e) = do
147 p <- applyExpr e >>= getString e
142 p <- applyExpr e >>= getString e