1-- | Exports a datastructure for the top-level hakyll configuration
3module Hakyll.Core.Configuration
4 ( HakyllConfiguration (..)
6 , defaultHakyllConfiguration
9import System.FilePath (takeFileName)
10import Data.List (isPrefixOf, isSuffixOf)
12data HakyllConfiguration = HakyllConfiguration
13 { -- | Directory in which the output written
14 destinationDirectory :: FilePath
15 , -- | Directory where hakyll's internal store is kept
16 storeDirectory :: FilePath
17 , -- | Function to determine ignored files
19 -- In 'defaultHakyllConfiguration', the following files are ignored:
21 -- * files starting with a @.@
23 -- * files ending with a @~@
25 -- * files ending with @.swp@
27 -- Note that the files in @destinationDirectory@ and @storeDirectory@ will
28 -- also be ignored. Note that this is the configuration parameter, if you
29 -- want to use the test, you should use @shouldIgnoreFile@.
31 ignoreFile :: FilePath -> Bool
32 , -- | Here, you can plug in a system command to upload/deploy your site.
36 -- > rsync -ave 'ssh -p 2217' _site jaspervdj@jaspervdj.be:hakyll
38 -- You can execute this by using
42 deployCommand :: String
45-- | Default configuration for a hakyll application
47defaultHakyllConfiguration :: HakyllConfiguration
48defaultHakyllConfiguration = HakyllConfiguration
49 { destinationDirectory = "_site"
50 , storeDirectory = "_cache"
51 , ignoreFile = ignoreFile'
52 , deployCommand = "echo 'No deploy command specified'"
56 | "." `isPrefixOf` fileName = True
57 | "~" `isSuffixOf` fileName = True
58 | ".swp" `isSuffixOf` fileName = True
61 fileName = takeFileName path
63-- | Check if a file should be ignored
65shouldIgnoreFile :: HakyllConfiguration -> FilePath -> Bool
66shouldIgnoreFile conf path =
67 destinationDirectory conf `isPrefixOf` path ||
68 storeDirectory conf `isPrefixOf` path ||
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list