summaryrefslogtreecommitdiff
path: root/src/Hakyll
diff options
context:
space:
mode:
Diffstat (limited to 'src/Hakyll')
-rw-r--r--src/Hakyll/Core/Configuration.hs4
-rw-r--r--src/Hakyll/Core/Runtime.hs9
2 files changed, 8 insertions, 5 deletions
diff --git a/src/Hakyll/Core/Configuration.hs b/src/Hakyll/Core/Configuration.hs
index 650fe97..df73e01 100644
--- a/src/Hakyll/Core/Configuration.hs
+++ b/src/Hakyll/Core/Configuration.hs
@@ -18,6 +18,9 @@ data Configuration = Configuration
destinationDirectory :: FilePath
, -- | Directory where hakyll's internal store is kept
storeDirectory :: FilePath
+ , -- | Directory where hakyll finds the files to compile. This is @.@ by
+ -- default.
+ providerDirectory :: FilePath
, -- | Function to determine ignored files
--
-- In 'defaultHakyllConfiguration', the following files are ignored:
@@ -58,6 +61,7 @@ defaultConfiguration :: Configuration
defaultConfiguration = Configuration
{ destinationDirectory = "_site"
, storeDirectory = "_cache"
+ , providerDirectory = "."
, ignoreFile = ignoreFile'
, deployCommand = "echo 'No deploy command specified'"
, inMemoryCache = True
diff --git a/src/Hakyll/Core/Runtime.hs b/src/Hakyll/Core/Runtime.hs
index d219252..dba2af9 100644
--- a/src/Hakyll/Core/Runtime.hs
+++ b/src/Hakyll/Core/Runtime.hs
@@ -42,15 +42,14 @@ import Hakyll.Core.Writable
--------------------------------------------------------------------------------
run :: Configuration -> Rules a -> IO RuleSet
-run configuration rules = do
+run config rules = do
-- Initialization
logger <- Logger.new Logger.Debug putStrLn
Logger.header logger "Initialising..."
Logger.message logger "Creating store..."
- store <- Store.new (inMemoryCache configuration) $
- storeDirectory configuration
+ store <- Store.new (inMemoryCache config) $ storeDirectory config
Logger.message logger "Creating provider..."
- provider <- newProvider store (ignoreFile configuration) "."
+ provider <- newProvider store (ignoreFile config) $ providerDirectory config
Logger.message logger "Running rules..."
ruleSet <- runRules rules provider
@@ -62,7 +61,7 @@ run configuration rules = do
-- Build runtime read/state
let compilers = rulesCompilers ruleSet
read' = RuntimeRead
- { runtimeConfiguration = configuration
+ { runtimeConfiguration = config
, runtimeLogger = logger
, runtimeProvider = provider
, runtimeStore = store