@@ -6,6 +6,7 @@ module Hakyll.Web.Template.Context
66 , field
77 , constField
88 , listField
9+ , listFieldWith
910 , functionField
1011 , mapContext
1112
@@ -104,7 +105,13 @@ constField key = field key . const . return
104105
105106--------------------------------------------------------------------------------
106107listField :: String -> Context a -> Compiler [Item a] -> Context b
107−listField key c xs = field' key $ \_ -> fmap (ListField c) xs
108+listField key c xs = listFieldWith key c (const xs)
109+
110+
111+--------------------------------------------------------------------------------
112+listFieldWith
113+ :: String -> Context a -> (Item b -> Compiler [Item a]) -> Context b
114+listFieldWith key c f = field' key $ fmap (ListField c) . f
108115
109116
110117--------------------------------------------------------------------------------