From 3a4f1d18b418439d9e623f516f694286e49d9764 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Thu, 23 Jun 2011 15:14:52 +0200 Subject: Don't cache pageCompilerWithFields Closes gh-33 --- src/Hakyll/Web/Page.hs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/Hakyll/Web') diff --git a/src/Hakyll/Web/Page.hs b/src/Hakyll/Web/Page.hs index b7cf6fb..6e24153 100644 --- a/src/Hakyll/Web/Page.hs +++ b/src/Hakyll/Web/Page.hs @@ -109,8 +109,12 @@ pageCompilerWith state options = pageCompilerWithPandoc state options id pageCompilerWithPandoc :: ParserState -> WriterOptions -> (Pandoc -> Pandoc) -> Compiler Resource (Page String) -pageCompilerWithPandoc state options f = - pageCompilerWithFields state options f id +pageCompilerWithPandoc state options f = cached cacheName $ + readPageCompiler >>> addDefaultFields >>> arr applySelf + >>> pageReadPandocWith state + >>> arr (fmap (writePandocWith options . f)) + where + cacheName = "Hakyll.Web.Page.pageCompilerWithPandoc" -- | This is another, even more advanced version of 'pageCompilerWithPandoc'. -- This function allows you to provide an arrow which is applied before the @@ -121,12 +125,10 @@ pageCompilerWithFields :: ParserState -> WriterOptions -> (Pandoc -> Pandoc) -> Compiler (Page String) (Page String) -> Compiler Resource (Page String) -pageCompilerWithFields state options f g = cached cacheName $ +pageCompilerWithFields state options f g = readPageCompiler >>> addDefaultFields >>> g >>> arr applySelf >>> pageReadPandocWith state >>> arr (fmap (writePandocWith options . f)) - where - cacheName = "Hakyll.Web.Page.pageCompilerWithFields" -- | Add a number of default metadata fields to a page. These fields include: -- -- cgit v1.2.3