hakyll 3.2.3.0 → 3.2.3.1
raw patch · 3 files changed
+35/−21 lines, 3 filesdep ~snap-coredep ~snap-server
Dependency ranges changed: snap-core, snap-server
Files
- hakyll.cabal +3/−3
- src/Hakyll/Web/Preview/Server.hs +13/−17
- src/Hakyll/Web/Template.hs +19/−1
hakyll.cabal view
@@ -1,5 +1,5 @@ Name: hakyll-Version: 3.2.3.0+Version: 3.2.3.1 Synopsis: A static website compiler library Description:@@ -136,8 +136,8 @@ If flag(previewServer) Build-depends:- snap-core >= 0.5.1 && < 0.6,- snap-server >= 0.5.1 && < 0.6+ snap-core >= 0.6 && < 0.8,+ snap-server >= 0.6 && < 0.8 Cpp-Options: -DPREVIEW_SERVER Other-Modules:
src/Hakyll/Web/Preview/Server.hs view
@@ -7,25 +7,21 @@ import Control.Monad.Trans (liftIO) -import Snap.Types (Snap)-import Snap.Util.FileServe ( DirectoryConfig (..), fancyDirectoryConfig- , serveDirectoryWith- )-import Snap.Http.Server ( httpServe, setAccessLog, setErrorLog- , setPort, emptyConfig- )+import qualified Snap.Core as Snap+import qualified Snap.Http.Server as Snap+import qualified Snap.Util.FileServe as Snap -- | Serve a given directory -- static :: FilePath -- ^ Directory to serve -> (FilePath -> IO ()) -- ^ Pre-serve hook- -> Snap ()+ -> Snap.Snap () static directory preServe =- serveDirectoryWith directoryConfig directory+ Snap.serveDirectoryWith directoryConfig directory where- directoryConfig :: DirectoryConfig Snap- directoryConfig = fancyDirectoryConfig- { preServeHook = liftIO . preServe+ directoryConfig :: Snap.DirectoryConfig Snap.Snap+ directoryConfig = Snap.fancyDirectoryConfig+ { Snap.preServeHook = liftIO . preServe } -- | Main method, runs a static server in the given directory@@ -35,10 +31,10 @@ -> Int -- ^ Port to listen on -> IO () -- ^ Blocks forever staticServer directory preServe port =- httpServe config $ static directory preServe+ Snap.httpServe config $ static directory preServe where -- Snap server config- config = setPort port- $ setAccessLog Nothing- $ setErrorLog Nothing- $ emptyConfig+ config = Snap.setPort port+ $ Snap.setAccessLog Snap.ConfigNoLog+ $ Snap.setErrorLog Snap.ConfigNoLog+ $ Snap.emptyConfig
src/Hakyll/Web/Template.hs view
@@ -39,7 +39,25 @@ -- -- In addition to the native format, Hakyll also supports hamlet templates. For -- more information on hamlet templates, please refer to:--- <http://hackage.haskell.org/package/hamlet>.+-- <http://hackage.haskell.org/package/hamlet>. Internally, hamlet templates are+-- converted to hakyll templates -- which means that you can only use variable+-- insertion (and not all hamlet's features).+--+-- This is an example of a valid hamlet template. You should place them in+-- files with a @.hamlet@ extension:+--+-- > !!!+-- > <html>+-- > <head>+-- > <meta charset="UTF-8">+-- > <title> MyAweSomeCompany - #{title}+-- > <body>+-- > <h1> MyAweSomeCompany - #{title}+-- > <div id="navigation">+-- > <a href="/index.html"> Home+-- > <a href="/about.html"> About+-- > <a href="/code.html"> Code+-- > #{body} -- module Hakyll.Web.Template ( Template