@@ -2,6 +2,7 @@
22--
33module Hakyll.Core.Configuration
44 ( HakyllConfiguration (..)
5+ , shouldIgnoreFile
56 , defaultHakyllConfiguration
67 ) where
78
@@ -23,6 +24,10 @@ data HakyllConfiguration = HakyllConfiguration
2324 --
2425 -- * files ending with @.swp@
2526 --
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@.
30+ --
2631 ignoreFile :: FilePath -> Bool
2732 }
2833
@@ -42,3 +47,11 @@ defaultHakyllConfiguration = HakyllConfiguration
4247 | otherwise = False
4348 where
4449 fileName = takeFileName path
50+
51+-- | Check if a file should be ignored
52+--
53+shouldIgnoreFile :: HakyllConfiguration -> FilePath -> Bool
54+shouldIgnoreFile conf path =
55+ destinationDirectory conf `isPrefixOf` path ||
56+ storeDirectory conf `isPrefixOf` path ||
57+ ignoreFile conf path