Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change ignoreFile to receive a complete filepath #667

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 58 additions & 58 deletions hakyll.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: hakyll
Version: 4.12.4.0
Version: 4.12.5.0

Synopsis: A static website compiler library
Description:
Expand Down Expand Up @@ -161,43 +161,43 @@ Library
Paths_hakyll

Build-Depends:
base >= 4.8 && < 5,
binary >= 0.5 && < 0.10,
blaze-html >= 0.5 && < 0.10,
blaze-markup >= 0.5.1 && < 0.9,
bytestring >= 0.9 && < 0.11,
containers >= 0.3 && < 0.6,
cryptohash >= 0.7 && < 0.12,
data-default >= 0.4 && < 0.8,
deepseq >= 1.3 && < 1.5,
directory >= 1.0 && < 1.4,
filepath >= 1.0 && < 1.5,
lrucache >= 1.1.1 && < 1.3,
mtl >= 1 && < 2.3,
network-uri >= 2.6 && < 2.7,
parsec >= 3.0 && < 3.2,
process >= 1.6 && < 1.7,
random >= 1.0 && < 1.2,
regex-tdfa >= 1.1 && < 1.3,
resourcet >= 1.1 && < 1.3,
scientific >= 0.3.4 && < 0.4,
tagsoup >= 0.13.1 && < 0.15,
text >= 0.11 && < 1.3,
time >= 1.8 && < 1.10,
time-locale-compat >= 0.1 && < 0.2,
unordered-containers >= 0.2 && < 0.3,
vector >= 0.11 && < 0.13,
yaml >= 0.8.11 && < 0.11,
optparse-applicative >= 0.12 && < 0.15,
file-embed >= 0.0.10.1 && < 0.0.12
base >= 4.8 ,
binary >= 0.5 ,
blaze-html >= 0.5 ,
blaze-markup >= 0.5.1 ,
bytestring >= 0.9 ,
containers >= 0.3 ,
cryptohash >= 0.7 ,
data-default >= 0.4 ,
deepseq >= 1.3 ,
directory >= 1.0 ,
filepath >= 1.0 ,
lrucache >= 1.1.1 ,
mtl >= 1 ,
network-uri >= 2.6 ,
parsec >= 3.0 ,
process >= 1.6 ,
random >= 1.0 ,
regex-tdfa >= 1.1 ,
resourcet >= 1.1 ,
scientific >= 0.3.4 ,
tagsoup >= 0.13.1 ,
text >= 0.11 ,
time >= 1.8 ,
time-locale-compat >= 0.1 ,
unordered-containers >= 0.2 ,
vector >= 0.11 ,
yaml >= 0.8.11 ,
optparse-applicative >= 0.12 ,
file-embed >= 0.0.10.1

If flag(previewServer)
Build-depends:
wai >= 3.2 && < 3.3,
warp >= 3.2 && < 3.3,
wai-app-static >= 3.1 && < 3.2,
http-types >= 0.9 && < 0.13,
fsnotify >= 0.2 && < 0.4
wai >= 3.2 ,
warp >= 3.2 ,
wai-app-static >= 3.1 ,
http-types >= 0.9 ,
fsnotify >= 0.2
Cpp-options:
-DPREVIEW_SERVER
Other-modules:
Expand All @@ -206,16 +206,16 @@ Library

If flag(watchServer)
Build-depends:
fsnotify >= 0.2 && < 0.4
fsnotify >= 0.2
Cpp-options:
-DWATCH_SERVER
Other-modules:
Hakyll.Preview.Poll

If flag(checkExternal)
Build-depends:
http-conduit >= 2.2 && < 2.4,
http-types >= 0.7 && < 0.13
http-conduit >= 2.2 ,
http-types >= 0.7
Cpp-options:
-DCHECK_EXTERNAL

Expand All @@ -227,8 +227,8 @@ Library
Other-Modules:
Hakyll.Web.Pandoc.Binary
Build-Depends:
pandoc >= 2.0.5 && < 2.3,
pandoc-citeproc >= 0.14 && < 0.15
pandoc >= 2.0.5 ,
pandoc-citeproc >= 0.14
Cpp-options:
-DUSE_PANDOC

Expand Down Expand Up @@ -259,18 +259,18 @@ Test-suite hakyll-tests

Build-Depends:
hakyll,
QuickCheck >= 2.8 && < 2.13,
tasty >= 0.11 && < 1.2,
tasty-hunit >= 0.9 && < 0.11,
tasty-quickcheck >= 0.8 && < 0.11,
QuickCheck >= 2.8 ,
tasty >= 0.11 ,
tasty-hunit >= 0.9 ,
tasty-quickcheck >= 0.8 ,
-- Copy pasted from hakyll dependencies:
base >= 4.8 && < 5,
bytestring >= 0.9 && < 0.11,
containers >= 0.3 && < 0.6,
filepath >= 1.0 && < 1.5,
text >= 0.11 && < 1.3,
unordered-containers >= 0.2 && < 0.3,
yaml >= 0.8.11 && < 0.11
base >= 4.8 ,
bytestring >= 0.9 ,
containers >= 0.3 ,
filepath >= 1.0 ,
text >= 0.11 ,
unordered-containers >= 0.2 ,
yaml >= 0.8.11

If flag(previewServer)
Cpp-options:
Expand Down Expand Up @@ -301,9 +301,9 @@ Executable hakyll-init

Build-depends:
hakyll,
base >= 4 && < 5,
directory >= 1.0 && < 1.4,
filepath >= 1.0 && < 1.5
base >= 4 ,
directory >= 1.0 ,
filepath >= 1.0

Executable hakyll-website
Main-is: site.hs
Expand All @@ -318,7 +318,7 @@ Executable hakyll-website

Build-depends:
hakyll,
base >= 4 && < 5,
directory >= 1.0 && < 1.4,
filepath >= 1.0 && < 1.5,
pandoc >= 2.0.5 && < 2.3
base >= 4 ,
directory >= 1.0 ,
filepath >= 1.0 ,
pandoc >= 2.0.5
3 changes: 2 additions & 1 deletion lib/Hakyll/Core/Compiler/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import Control.Applicative (Alternative (..))
import Control.Exception (SomeException, handle)
import Control.Monad (forM_)
import Control.Monad.Except (MonadError (..))
import Control.Monad.Fail
#if MIN_VERSION_base(4,9,0)
import Data.Semigroup (Semigroup (..))
#endif
Expand Down Expand Up @@ -156,10 +157,10 @@ instance Monad Compiler where
CompilerRequire i c' -> return $ CompilerRequire i (c' >>= f)
{-# INLINE (>>=) #-}

instance MonadFail Compiler where
fail = compilerThrow . return
{-# INLINE fail #-}


--------------------------------------------------------------------------------
instance Applicative Compiler where
pure x = return x
Expand Down
6 changes: 3 additions & 3 deletions lib/Hakyll/Core/Util/File.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ getRecursiveContents :: (FilePath -> IO Bool) -- ^ Ignore this file/directory
-> IO [FilePath] -- ^ List of files found
getRecursiveContents ignore top = go ""
where
isProper x
isProper dir x
| x `elem` [".", ".."] = return False
| otherwise = not <$> ignore x
| otherwise = not <$> ignore (dir </> x)

go dir = do
dirExists <- doesDirectoryExist (top </> dir)
if not dirExists
then return []
else do
names <- filterM isProper =<< getDirectoryContents (top </> dir)
names <- filterM (isProper dir) =<< getDirectoryContents (top </> dir)
paths <- forM names $ \name -> do
let rel = dir </> name
isDirectory <- doesDirectoryExist (top </> rel)
Expand Down