@@ -18,7 +18,7 @@ module Hakyll.Web.Template.Internal
1818
1919
2020--------------------------------------------------------------------------------
21−import Control.Applicative ((<|>))
21+import Control.Monad (forM)
2222import Control.Monad.Except (MonadError (..))
2323import Data.Binary (Binary)
2424import Data.List (intercalate)
@@ -135,13 +135,8 @@ applyTemplate' tes context x = go tes
135135 "got StringField for expr " ++ show e
136136 ListField c xs -> do
137137 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
139139 return $ intercalate sep bs
140− where
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
145140
146141 applyElem (Partial e) = do
147142 p <- applyExpr e >>= getString e