Ignore temp files

This commit is contained in:
Mats Rauhala 2021-01-25 19:35:21 +02:00
parent 59cf230683
commit 7e290bee2f
1 changed files with 12 additions and 2 deletions

View File

@ -3,12 +3,15 @@
import Hakyll
import Data.List
(isSuffixOf)
(isPrefixOf, isSuffixOf)
import System.FilePath
(takeFileName)
--------------------------------------------------------------------------------
main :: IO ()
main = hakyllWith defaultConfiguration $ do
main = hakyllWith defaultConfiguration{ignoreFile = ignore} $ do
match "well-known/*" $ do
route (customRoute (prepend '.'. toFilePath))
compile copyFileCompiler
@ -38,6 +41,13 @@ main = hakyllWith defaultConfiguration $ do
match "templates/*" $ compile templateBodyCompiler
where
ignore path = any ($ takeFileName path)
[ ("." `isPrefixOf`)
, ("#" `isPrefixOf`)
, ("~" `isSuffixOf`)
, (".swp" `isSuffixOf`)
]
prepend :: a -> [a] -> [a]