on master help sign in
Merge branch 'master' of github.com:jaspervdj/hakyll
commit0639a73c24508a93e422d97d126d8ec261ecb77e authorJasper Van der Jeugt <m@jaspervdj.be> dateFri 9 May 2014, 11:51 (12 years ago) parent822976543c2aea
5 files changed+17−9
data/example/index.html+1−1 src/Hakyll/Core/UnixFilter.hs+11−8 src/Hakyll/Web/Html.hs+1 tests/Hakyll/Web/Html/Tests.hs+2 web/examples.markdown+2
data/example/index.html+1−1
@@ -13,4 +13,4 @@ title: Home
1313<h2>Posts</h2>
1414$partial("templates/post-list.html")$
1515
16−<p>…or you can find more in the <a href="/archive.html">archives</a>.
16+<p>…or you can find more in the <a href="/archive.html">archives</a>.</p>
src/Hakyll/Core/UnixFilter.hs+11−8
@@ -1,3 +1,5 @@
1+{-# LANGUAGE CPP #-}
2+
13--------------------------------------------------------------------------------
24-- | A Compiler that supports unix filters.
35module Hakyll.Core.UnixFilter
@@ -19,7 +21,6 @@ import System.Exit (ExitCode (..))
1921import System.IO (Handle, hClose, hFlush, hGetContents,
2022 hPutStr, hSetEncoding, localeEncoding)
2123import System.Process
22−import qualified System.Info as System
2324
2425--------------------------------------------------------------------------------
2526import Hakyll.Core.Compiler
@@ -105,17 +106,19 @@ unixFilterIO :: Monoid o
105106 -> i
106107 -> IO (o, String, ExitCode)
107108unixFilterIO writer reader programName args input = do
108− -- The problem on Windows is that `proc` is that it is unable to execute
109+ -- The problem on Windows is that `proc` is unable to execute
109110 -- batch stubs (eg. anything created using 'gem install ...') even if its in
110111 -- `$PATH`. A solution to this issue is to execute the batch file explicitly
111112 -- using `cmd /c batchfile` but there is no rational way to know where said
112113 -- batchfile is on the system. Hence, we detect windows using the
113− -- `System.Info` module and then instead of using `proc` to create the
114− -- process, use `shell` instead which will be able to execute everything
115− -- `proc` can, and this can deal with batch files as well.
116− let pr = if System.os == "mingw32"
117− then shell $ unwords (programName : args)
118− else proc programName args
114+ -- CPP and instead of using `proc` to create the process, use `shell`
115+ -- which will be able to execute everything `proc` can
116+ -- as well as batch files.
117+#ifdef mingw32_HOST_OS
118+ let pr = shell $ unwords (programName : args)
119+#else
120+ let pr = proc programName args
121+#endif
119122
120123 (Just inh, Just outh, Just errh, pid) <-
121124 createProcess pr
src/Hakyll/Web/Html.hs+1
@@ -124,6 +124,7 @@ toSiteRoot = emptyException . joinPath . map parent
124124 emptyException x = x
125125 relevant "." = False
126126 relevant "/" = False
127+ relevant "./" = False
127128 relevant _ = True
128129
129130
tests/Hakyll/Web/Html/Tests.hs+2
@@ -59,6 +59,8 @@ tests = testGroup "Hakyll.Web.Html.Tests" $ concat
5959 , "." @=? toSiteRoot "index.html"
6060 , "." @=? toSiteRoot "/index.html"
6161 , "../.." @=? toSiteRoot "foo/bar/qux"
62+ , ".." @=? toSiteRoot "./foo/bar.html"
63+ , ".." @=? toSiteRoot "/foo/./bar.html"
6264 ]
6365
6466 , fromAssertions "isExternal"
web/examples.markdown+2
@@ -85,6 +85,8 @@ this list. This list has no particular ordering.
8585 [source](https://github.com/TikhonJelvis/website)
8686- <https://secure.plaimi.net/>,
8787 [source](https://github.com/plaimi/www)
88+- <http://duplode.github.io/>,
89+ [source](https://github.com/duplode/duplode.github.io/tree/sources)
8890
8991## Hakyll 3.X
9092