hakyll 4.3.1.0 → 4.3.2.0
raw patch · 5 files changed
+17/−4 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Hakyll.Web.Template.Context: mapContext :: (String -> String) -> Context a -> Context a
Files
- hakyll.cabal +1/−1
- src/Hakyll/Check.hs +2/−1
- src/Hakyll/Core/Identifier/Pattern.hs +1/−1
- src/Hakyll/Core/UnixFilter.hs +2/−0
- src/Hakyll/Web/Template/Context.hs +11/−1
hakyll.cabal view
@@ -1,5 +1,5 @@ Name: hakyll-Version: 4.3.1.0+Version: 4.3.2.0 Synopsis: A static website compiler library Description:
src/Hakyll/Check.hs view
@@ -18,6 +18,7 @@ import Data.Monoid (Monoid (..)) import Data.Set (Set) import qualified Data.Set as S+import Network.URI (unEscapeString) import System.Directory (doesDirectoryExist, doesFileExist) import System.Exit (ExitCode (..)) import System.FilePath (takeDirectory, takeExtension, (</>))@@ -182,7 +183,7 @@ exists <- checkFileExists filePath if exists then ok url else faulty url where- url' = stripFragments url+ url' = stripFragments $ unEscapeString url --------------------------------------------------------------------------------
src/Hakyll/Core/Identifier/Pattern.hs view
@@ -292,7 +292,7 @@ -- -- Example: ----- > fromCapture (parseGlob "tags/*") "foo"+-- > fromCapture (fromGlob "tags/*") "foo" -- -- Result: --
src/Hakyll/Core/UnixFilter.hs view
@@ -129,7 +129,9 @@ -- Read from stderr _ <- forkIO $ do+ hSetEncoding errh localeEncoding err <- hGetContents errh+ _ <- deepseq err (return err) hClose errh writeIORef errRef err putMVar lock ()
src/Hakyll/Web/Template/Context.hs view
@@ -6,6 +6,7 @@ , field , constField , listField+ , mapContext , defaultContext , bodyField@@ -86,6 +87,15 @@ --------------------------------------------------------------------------------+mapContext :: (String -> String) -> Context a -> Context a+mapContext f (Context c) = Context $ \k i -> do+ fld <- c k i+ return $ case fld of+ StringField str -> StringField (f str)+ ListField ctx is -> ListField ctx is+++-------------------------------------------------------------------------------- defaultContext :: Context String defaultContext = bodyField "body" `mappend`@@ -130,7 +140,7 @@ -------------------------------------------------------------------------------- -- | This title field takes the basename of the underlying file by default titleField :: String -> Context a-titleField key = field key $ return . takeBaseName . toFilePath . itemIdentifier+titleField = mapContext takeBaseName . pathField --------------------------------------------------------------------------------