-- | Exports a datatype for the top-level achille config.
module Achille.Config
    ( Config (..)
    , def
    ) where


import System.FilePath (FilePath)
import Data.Default    (Default, def)


-- | achille configuration datatype.
data Config = Config
    { Config -> FilePath
contentDir :: FilePath      -- ^ Root of the source directory.
                                  --   Defaults to @"content"@.
    , Config -> FilePath
outputDir  :: FilePath      -- ^ Root of the output directory.
                                  --   Defaults to @"_site"@.
    , Config -> FilePath
cacheFile  :: FilePath      -- ^ Path where the cache is stored.
                                  --   Defaults to @".cache"@.
    , Config -> Maybe FilePath
deployCmd  :: Maybe String  -- ^ Command to run for deploying the result.
    }


instance Default Config where
    def :: Config
def = Config :: FilePath -> FilePath -> FilePath -> Maybe FilePath -> Config
Config
        { contentDir :: FilePath
contentDir = "content"
        , outputDir :: FilePath
outputDir  = "_site"
        , cacheFile :: FilePath
cacheFile  = ".cache"
        , deployCmd :: Maybe FilePath
deployCmd  = Maybe FilePath
forall a. Maybe a
Nothing
        }