1--------------------------------------------------------------------------------
2-- | Exports a datastructure for the top-level hakyll configuration
3module Hakyll.Core.Configuration
10--------------------------------------------------------------------------------
11import Data.List (isPrefixOf, isSuffixOf)
12import System.FilePath (takeFileName)
15--------------------------------------------------------------------------------
16data Configuration = Configuration
17 { -- | Directory in which the output written
18 destinationDirectory :: FilePath
19 , -- | Directory where hakyll's internal store is kept
20 storeDirectory :: FilePath
21 , -- | Function to determine ignored files
23 -- In 'defaultHakyllConfiguration', the following files are ignored:
25 -- * files starting with a @.@
27 -- * files starting with a @#@
29 -- * files ending with a @~@
31 -- * files ending with @.swp@
33 -- Note that the files in @destinationDirectory@ and @storeDirectory@ will
34 -- also be ignored. Note that this is the configuration parameter, if you
35 -- want to use the test, you should use @shouldIgnoreFile@.
37 ignoreFile :: FilePath -> Bool
38 , -- | Here, you can plug in a system command to upload/deploy your site.
42 -- > rsync -ave 'ssh -p 2217' _site jaspervdj@jaspervdj.be:hakyll
44 -- You can execute this by using
48 deployCommand :: String
49 , -- | Use an in-memory cache for items. This is faster but uses more
55--------------------------------------------------------------------------------
56-- | Default configuration for a hakyll application
57defaultConfiguration :: Configuration
58defaultConfiguration = Configuration
59 { destinationDirectory = "_site"
60 , storeDirectory = "_cache"
61 , ignoreFile = ignoreFile'
62 , deployCommand = "echo 'No deploy command specified'"
63 , inMemoryCache = True
67 | "." `isPrefixOf` fileName = True
68 | "#" `isPrefixOf` fileName = True
69 | "~" `isSuffixOf` fileName = True
70 | ".swp" `isSuffixOf` fileName = True
73 fileName = takeFileName path
76--------------------------------------------------------------------------------
77-- | Check if a file should be ignored
78shouldIgnoreFile :: Configuration -> FilePath -> Bool
79shouldIgnoreFile conf path =
80 destinationDirectory conf `isPrefixOf` path ||
81 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