on master help sign in
Don't cache pageCompilerWithFields

Closes gh-33

commit3a4f1d18b418439d9e623f516f694286e49d9764 authorJasper Van der Jeugt <jaspervdj@gmail.com> dateThu 23 Jun 2011, 15:14 (15 years ago) parentdac77b9
1 file changed+7−5
src/Hakyll/Web/Page.hs+7−5
src/Hakyll/Web/Page.hs+7−5
@@ -109,8 +109,12 @@ pageCompilerWith state options = pageCompilerWithPandoc state options id
109109pageCompilerWithPandoc :: ParserState -> WriterOptions
110110 -> (Pandoc -> Pandoc)
111111 -> Compiler Resource (Page String)
112−pageCompilerWithPandoc state options f =
113− pageCompilerWithFields state options f id
112+pageCompilerWithPandoc state options f = cached cacheName $
113+ readPageCompiler >>> addDefaultFields >>> arr applySelf
114+ >>> pageReadPandocWith state
115+ >>> arr (fmap (writePandocWith options . f))
116+ where
117+ cacheName = "Hakyll.Web.Page.pageCompilerWithPandoc"
114118
115119-- | This is another, even more advanced version of 'pageCompilerWithPandoc'.
116120-- This function allows you to provide an arrow which is applied before the
@@ -121,12 +125,10 @@ pageCompilerWithFields :: ParserState -> WriterOptions
121125 -> (Pandoc -> Pandoc)
122126 -> Compiler (Page String) (Page String)
123127 -> Compiler Resource (Page String)
124−pageCompilerWithFields state options f g = cached cacheName $
128+pageCompilerWithFields state options f g =
125129 readPageCompiler >>> addDefaultFields >>> g >>> arr applySelf
126130 >>> pageReadPandocWith state
127131 >>> arr (fmap (writePandocWith options . f))
128− where
129− cacheName = "Hakyll.Web.Page.pageCompilerWithFields"
130132
131133-- | Add a number of default metadata fields to a page. These fields include:
132134--