packages feed

hakyll 4.12.5.0 → 4.12.5.1

raw patch · 4 files changed

+25/−36 lines, 4 filesdep ~pandocdep ~pandoc-citeprocPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: pandoc, pandoc-citeproc

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -4,6 +4,11 @@  # Releases +## Hakyll 4.12.5.1 (2019-02-03)++- Bump pandoc to 2.6+- Bump pandoc-citeproc to 0.16+ ## Hakyll 4.12.5.0 (2019-01-12)  - Update dependencies (contribution by Hexirp):
hakyll.cabal view
@@ -1,5 +1,5 @@ Name:    hakyll-Version: 4.12.5.0+Version: 4.12.5.1  Synopsis: A static website compiler library Description:@@ -68,6 +68,7 @@   tests/data/partial.html   tests/data/partial.html.out   tests/data/posts/2010-08-26-birthday.md+  tests/data/posts/2018-09-26.md   tests/data/russian.md   tests/data/strip.html   tests/data/strip.html.out@@ -227,8 +228,8 @@     Other-Modules:       Hakyll.Web.Pandoc.Binary     Build-Depends:-      pandoc          >= 2.0.5    && < 2.6,-      pandoc-citeproc >= 0.14     && < 0.16+      pandoc          >= 2.0.5    && < 2.7,+      pandoc-citeproc >= 0.14     && < 0.17     Cpp-options:       -DUSE_PANDOC @@ -321,4 +322,4 @@     base      >= 4     && < 5,     directory >= 1.0   && < 1.4,     filepath  >= 1.0   && < 1.5,-    pandoc    >= 2.0.5 && < 2.6+    pandoc    >= 2.0.5 && < 2.7
+ tests/data/posts/2018-09-26.md view
@@ -0,0 +1,1 @@+Something happened today.
web/site.hs view
@@ -1,8 +1,7 @@ -------------------------------------------------------------------------------- {-# LANGUAGE OverloadedStrings #-} import           Control.Arrow    (second)-import           Control.Monad    (forM_)-import           Data.Char        (isDigit)+import           Control.Monad    (filterM, forM_) import           Data.List        (isPrefixOf, sortBy) import           Data.Monoid      ((<>)) import           Data.Ord         (comparing)@@ -57,17 +56,11 @@     create ["tutorials.html"] $ do         route idRoute         compile $ do-            tuts <-+            ctx <- tutorialsCtx <$>                 sortBy (comparing itemIdentifier) <$> loadAll "tutorials/*"--            let tutorialsCtx =-                    constField "title" "Tutorials"  `mappend`-                    listField "tutorials"   tutorialCtx (return tuts) `mappend`-                    defaultContext-             makeItem ""-                >>= loadAndApplyTemplate "templates/tutorials.html" tutorialsCtx-                >>= loadAndApplyTemplate "templates/default.html" tutorialsCtx+                >>= loadAndApplyTemplate "templates/tutorials.html" ctx+                >>= loadAndApplyTemplate "templates/default.html"   ctx                 >>= relativizeUrls      -- Templates@@ -109,27 +102,16 @@   ---------------------------------------------------------------------------------data TutorialType = SeriesTutorial | ArticlesTutorial | ExternalTutorial-    deriving (Eq)----------------------------------------------------------------------------------- -- | Partition tutorials into tutorial series, other articles, external articles-tutorialCtx :: Context String-tutorialCtx =-    field "isSeries"   (isTutorialType SeriesTutorial)   <>-    field "isArticle"  (isTutorialType ArticlesTutorial) <>-    field "isExternal" (isTutorialType ExternalTutorial) <>+tutorialsCtx :: [Item String] -> Context String+tutorialsCtx tuts =+    constField "title" "Tutorials"                                    <>+    listField "main"          defaultContext (ofType "main")          <>+    listField "articles"      defaultContext (ofType "article")       <>+    listField "externals"     defaultContext (ofType "external")      <>+    listField "robertwpearce" defaultContext (ofType "robertwpearce") <>     defaultContext   where-    getTutorialType item = do-        mbExternal <- getMetadataField (itemIdentifier item) "external"-        return $ case mbExternal of-            Just _ -> ExternalTutorial-            _      -> case splitPath (toFilePath $ itemIdentifier item) of-                [_, (x : _)] -> if isDigit x then SeriesTutorial else ArticlesTutorial-                _            -> ArticlesTutorial--    isTutorialType ty0 item = do-        ty1 <- getTutorialType item-        if ty0 == ty1 then return "yes" else fail "no"+    ofType ty = filterM (\item -> do+        mbType <- getMetadataField (itemIdentifier item) "type"+        return $ Just ty == mbType) tuts