From 1af0421efe7983eb5634440ec162da48518b0b78 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sat, 31 Jul 2010 12:55:41 +0200 Subject: Option to choose between preview modes --- src/Text/Hakyll/HakyllMonad.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/Text/Hakyll') diff --git a/src/Text/Hakyll/HakyllMonad.hs b/src/Text/Hakyll/HakyllMonad.hs index 9535a66..f17ae52 100644 --- a/src/Text/Hakyll/HakyllMonad.hs +++ b/src/Text/Hakyll/HakyllMonad.hs @@ -1,6 +1,7 @@ -- | Module describing the Hakyll monad stack. module Text.Hakyll.HakyllMonad ( HakyllConfiguration (..) + , PreviewMode (..) , Hakyll , askHakyll , getAdditionalContext @@ -15,9 +16,17 @@ import Text.Pandoc (ParserState, WriterOptions) import Text.Hakyll.Context (Context (..)) -- | Our custom monad stack. +-- type Hakyll = ReaderT HakyllConfiguration IO +-- | Preview mode. +-- +data PreviewMode = BuildOnRequest + | BuildOnInterval + deriving (Show, Eq, Ord) + -- | Hakyll global configuration type. +-- data HakyllConfiguration = HakyllConfiguration { -- | Absolute URL of the site. absoluteUrl :: String @@ -30,6 +39,8 @@ data HakyllConfiguration = HakyllConfiguration cacheDirectory :: FilePath , -- | Enable index links. enableIndexUrl :: Bool + , -- | The preview mode used + previewMode :: PreviewMode , -- | Pandoc parsing options pandocParserState :: ParserState , -- | Pandoc writer options -- cgit v1.2.3