summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hakyll.cabal10
-rw-r--r--src/Hakyll/Core/Compiler/Internal.hs3
-rw-r--r--src/Hakyll/Core/Dependencies.hs6
-rw-r--r--src/Hakyll/Core/Metadata.hs3
-rw-r--r--src/Hakyll/Core/Provider/Internal.hs7
-rw-r--r--src/Hakyll/Web/Paginate.hs5
-rw-r--r--src/Hakyll/Web/Pandoc.hs1
-rw-r--r--src/Hakyll/Web/Tags.hs8
-rw-r--r--tests/Hakyll/Core/Dependencies/Tests.hs3
-rw-r--r--web/releases.markdown11
-rw-r--r--web/tutorials/faq.markdown3
11 files changed, 40 insertions, 20 deletions
diff --git a/hakyll.cabal b/hakyll.cabal
index 40fa251..9087673 100644
--- a/hakyll.cabal
+++ b/hakyll.cabal
@@ -1,5 +1,5 @@
Name: hakyll
-Version: 4.5.1.0
+Version: 4.5.3.0
Synopsis: A static website compiler library
Description:
@@ -154,10 +154,10 @@ Library
filepath >= 1.0 && < 1.4,
lrucache >= 1.1.1 && < 1.2,
mtl >= 1 && < 2.2,
- network >= 2.4 && < 2.5,
+ network >= 2.4 && < 2.6,
old-locale >= 1.0 && < 1.1,
old-time >= 1.0 && < 1.2,
- pandoc >= 1.12 && < 1.13,
+ pandoc >= 1.12.4 && < 1.13,
pandoc-citeproc >= 0.1 && < 0.4,
parsec >= 3.0 && < 3.2,
process >= 1.0 && < 1.3,
@@ -240,10 +240,10 @@ Test-suite hakyll-tests
filepath >= 1.0 && < 1.4,
lrucache >= 1.1.1 && < 1.2,
mtl >= 1 && < 2.2,
- network >= 2.4 && < 2.5,
+ network >= 2.4 && < 2.6,
old-locale >= 1.0 && < 1.1,
old-time >= 1.0 && < 1.2,
- pandoc >= 1.12 && < 1.13,
+ pandoc >= 1.12.4 && < 1.13,
pandoc-citeproc >= 0.1 && < 0.4,
parsec >= 3.0 && < 3.2,
process >= 1.0 && < 1.3,
diff --git a/src/Hakyll/Core/Compiler/Internal.hs b/src/Hakyll/Core/Compiler/Internal.hs
index 259cd35..8424d69 100644
--- a/src/Hakyll/Core/Compiler/Internal.hs
+++ b/src/Hakyll/Core/Compiler/Internal.hs
@@ -248,5 +248,6 @@ compilerGetMatches :: Pattern -> Compiler [Identifier]
compilerGetMatches pattern = do
universe <- compilerUniverse <$> compilerAsk
let matching = filterMatches pattern $ S.toList universe
- compilerTellDependencies [PatternDependency pattern matching]
+ set' = S.fromList matching
+ compilerTellDependencies [PatternDependency pattern set']
return matching
diff --git a/src/Hakyll/Core/Dependencies.hs b/src/Hakyll/Core/Dependencies.hs
index 7597e61..ebb6fd0 100644
--- a/src/Hakyll/Core/Dependencies.hs
+++ b/src/Hakyll/Core/Dependencies.hs
@@ -32,7 +32,7 @@ import Hakyll.Core.Identifier.Pattern
--------------------------------------------------------------------------------
data Dependency
- = PatternDependency Pattern [Identifier]
+ = PatternDependency Pattern (Set Identifier)
| IdentifierDependency Identifier
deriving (Show, Typeable)
@@ -91,7 +91,7 @@ dependenciesFor id' = do
return $ concatMap dependenciesFor' $ fromMaybe [] $ M.lookup id' facts
where
dependenciesFor' (IdentifierDependency i) = [i]
- dependenciesFor' (PatternDependency _ is) = is
+ dependenciesFor' (PatternDependency _ is) = S.toList is
--------------------------------------------------------------------------------
@@ -116,7 +116,7 @@ checkChangedPatterns = do
go _ ds (IdentifierDependency i) = return $ IdentifierDependency i : ds
go id' ds (PatternDependency p ls) = do
universe <- ask
- let ls' = filterMatches p universe
+ let ls' = S.fromList $ filterMatches p universe
if ls == ls'
then return $ PatternDependency p ls : ds
else do
diff --git a/src/Hakyll/Core/Metadata.hs b/src/Hakyll/Core/Metadata.hs
index 7902b94..3ce854f 100644
--- a/src/Hakyll/Core/Metadata.hs
+++ b/src/Hakyll/Core/Metadata.hs
@@ -12,6 +12,7 @@ module Hakyll.Core.Metadata
import Control.Monad (forM)
import Data.Map (Map)
import qualified Data.Map as M
+import qualified Data.Set as S
--------------------------------------------------------------------------------
@@ -60,4 +61,4 @@ getMetadataField' identifier key = do
makePatternDependency :: MonadMetadata m => Pattern -> m Dependency
makePatternDependency pattern = do
matches' <- getMatches pattern
- return $ PatternDependency pattern matches'
+ return $ PatternDependency pattern (S.fromList matches')
diff --git a/src/Hakyll/Core/Provider/Internal.hs b/src/Hakyll/Core/Provider/Internal.hs
index fdf1342..34400fd 100644
--- a/src/Hakyll/Core/Provider/Internal.hs
+++ b/src/Hakyll/Core/Provider/Internal.hs
@@ -31,8 +31,7 @@ import Data.Maybe (fromMaybe)
import Data.Monoid (mempty)
import Data.Set (Set)
import qualified Data.Set as S
-import Data.Time (Day (..), UTCTime (..),
- secondsToDiffTime)
+import Data.Time (Day (..), UTCTime (..))
import Data.Typeable (Typeable)
import System.Directory (getModificationTime)
import System.FilePath (addExtension, (</>))
@@ -62,11 +61,11 @@ newtype BinaryTime = BinaryTime {unBinaryTime :: UTCTime}
--------------------------------------------------------------------------------
instance Binary BinaryTime where
put (BinaryTime (UTCTime (ModifiedJulianDay d) dt)) =
- put d >> put (floor dt :: Integer)
+ put d >> put (toRational dt)
get = fmap BinaryTime $ UTCTime
<$> (ModifiedJulianDay <$> get)
- <*> (secondsToDiffTime <$> get)
+ <*> (fromRational <$> get)
--------------------------------------------------------------------------------
diff --git a/src/Hakyll/Web/Paginate.hs b/src/Hakyll/Web/Paginate.hs
index eafd3a9..1af792e 100644
--- a/src/Hakyll/Web/Paginate.hs
+++ b/src/Hakyll/Web/Paginate.hs
@@ -15,6 +15,7 @@ import Control.Monad (forM_)
import Data.List (unfoldr)
import qualified Data.Map as M
import Data.Monoid (mconcat)
+import qualified Data.Set as S
import Text.Printf (printf)
@@ -58,7 +59,7 @@ buildPaginate pattern = do
"invalid page number: " ++ show pn
return $ Paginate pagPages pagPlaces makeId
- (PatternDependency pattern idents)
+ (PatternDependency pattern (S.fromList idents))
--------------------------------------------------------------------------------
@@ -81,7 +82,7 @@ buildPaginateWith n makeId pattern = do
[(makeId i, i) | i <- [1 .. nPages]]
return $ Paginate (M.fromList paginatePages') (M.fromList pagPlaces') makeId
- (PatternDependency pattern idents)
+ (PatternDependency pattern (S.fromList idents))
--------------------------------------------------------------------------------
diff --git a/src/Hakyll/Web/Pandoc.hs b/src/Hakyll/Web/Pandoc.hs
index 1615167..78df1df 100644
--- a/src/Hakyll/Web/Pandoc.hs
+++ b/src/Hakyll/Web/Pandoc.hs
@@ -53,6 +53,7 @@ readPandocWith ropt item = fmap (reader ropt (itemFileType item)) item
LaTeX -> readLaTeX ro
LiterateHaskell t' -> reader (addExt ro Ext_literate_haskell) t'
Markdown -> readMarkdown ro
+ OrgMode -> readOrg ro
Rst -> readRST ro
Textile -> readTextile ro
_ -> error $
diff --git a/src/Hakyll/Web/Tags.hs b/src/Hakyll/Web/Tags.hs
index 0fa182c..0887856 100644
--- a/src/Hakyll/Web/Tags.hs
+++ b/src/Hakyll/Web/Tags.hs
@@ -71,6 +71,7 @@ import qualified Data.Map as M
import Data.Maybe (catMaybes, fromMaybe)
import Data.Monoid (mconcat)
import Data.Ord (comparing)
+import qualified Data.Set as S
import System.FilePath (takeBaseName, takeDirectory)
import Text.Blaze.Html (toHtml, toValue, (!))
import Text.Blaze.Html.Renderer.String (renderHtml)
@@ -124,7 +125,8 @@ buildTagsWith :: MonadMetadata m
buildTagsWith f pattern makeId = do
ids <- getMatches pattern
tagMap <- foldM addTags M.empty ids
- return $ Tags (M.toList tagMap) makeId (PatternDependency pattern ids)
+ let set' = S.fromList ids
+ return $ Tags (M.toList tagMap) makeId (PatternDependency pattern set')
where
-- Create a tag map for one page
addTags tagMap id' = do
@@ -148,8 +150,8 @@ buildCategories = buildTagsWith getCategory
tagsRules :: Tags -> (String -> Pattern -> Rules ()) -> Rules ()
tagsRules tags rules =
forM_ (tagsMap tags) $ \(tag, identifiers) ->
- create [tagsMakeId tags tag] $
- rulesExtraDependencies [tagsDependency tags] $
+ rulesExtraDependencies [tagsDependency tags] $
+ create [tagsMakeId tags tag] $
rules tag $ fromList identifiers
diff --git a/tests/Hakyll/Core/Dependencies/Tests.hs b/tests/Hakyll/Core/Dependencies/Tests.hs
index d6e3094..efa848b 100644
--- a/tests/Hakyll/Core/Dependencies/Tests.hs
+++ b/tests/Hakyll/Core/Dependencies/Tests.hs
@@ -38,7 +38,8 @@ oldFacts = M.fromList
, ("posts/02.md",
[])
, ("index.md",
- [ PatternDependency "posts/*" ["posts/01.md", "posts/02.md"]
+ [ PatternDependency "posts/*"
+ (S.fromList ["posts/01.md", "posts/02.md"])
, IdentifierDependency "posts/01.md"
, IdentifierDependency "posts/02.md"
])
diff --git a/web/releases.markdown b/web/releases.markdown
index 09d8153..cc704f1 100644
--- a/web/releases.markdown
+++ b/web/releases.markdown
@@ -4,6 +4,17 @@ title: Releases
# Releases
+## Hakyll 4.5.3.0
+
+- Bump Pandoc to 1.12.4 to include the org-mode reader.
+
+## Hakyll 4.5.2.0
+
+- Fix rebuilding everything issue with latest directory (contribution by Jorge
+ Israel Peña)
+- Fix issue with `toSiteRoot` (contribution by Izzy Cecil)
+- Fix issue with tag dependencies, slightly improve caching
+
## Hakyll 4.5.0.0
- Fix issue with syntax highlighting and line numbers (contribution by Adelbert
diff --git a/web/tutorials/faq.markdown b/web/tutorials/faq.markdown
index 66dd4e6..87c1a92 100644
--- a/web/tutorials/faq.markdown
+++ b/web/tutorials/faq.markdown
@@ -24,6 +24,9 @@ using something like:
You should also add this to your `.profile`, or whatever config file you use.
+On Windows, running `chcp 65001` before running your Hakyll executable has been
+reported to work.
+
## "File name does not match module name" on Mac OS
Hakyll.hs:1:1: