@@ -8,9 +8,11 @@ module Hakyll.Core.Configuration
88
99
1010--------------------------------------------------------------------------------
11+import Control.Monad (void)
1112import Data.Default (Default(..))
1213import Data.List (isPrefixOf, isSuffixOf)
1314import System.FilePath (normalise, takeFileName)
15+import System.Process (system)
1416
1517
1618--------------------------------------------------------------------------------
@@ -52,6 +54,16 @@ data Configuration = Configuration
5254 -- > ./site deploy
5355 --
5456 deployCommand :: String
57+ , -- | Function to deploy the site from Haskell.
58+ --
59+ -- By default, this command executes the shell command stored in
60+ -- 'deployCommand'. If you override it, 'deployCommand' will not
61+ -- be used implicitely.
62+ --
63+ -- The 'Configuration' object is passed as a parameter to this
64+ -- function.
65+ --
66+ deploySite :: Configuration -> IO ()
5567 , -- | Use an in-memory cache for items. This is faster but uses more
5668 -- memory.
5769 inMemoryCache :: Bool
@@ -71,6 +83,7 @@ defaultConfiguration = Configuration
7183 , providerDirectory = "."
7284 , ignoreFile = ignoreFile'
7385 , deployCommand = "echo 'No deploy command specified'"
86+ , deploySite = void . system . deployCommand
7487 , inMemoryCache = True
7588 }
7689 where