From 7e290bee2f07b446dd873df236e7abeeaf695298 Mon Sep 17 00:00:00 2001 From: Mats Rauhala Date: Mon, 25 Jan 2021 19:35:21 +0200 Subject: [PATCH] Ignore temp files --- site/app/site.hs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/site/app/site.hs b/site/app/site.hs index d7d712b..161c89e 100644 --- a/site/app/site.hs +++ b/site/app/site.hs @@ -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]