From cc5ea59b8cc52a0a7afa092af799761db2c4c7c1 Mon Sep 17 00:00:00 2001 From: Izzy Cecil Date: Sat, 19 Apr 2014 17:20:58 -0600 Subject: [PATCH 1/5] ADD: Added failing test cases for `toSiteRoot`. --- tests/Hakyll/Web/Html/Tests.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/Hakyll/Web/Html/Tests.hs b/tests/Hakyll/Web/Html/Tests.hs index e150ea2..bad5ebc 100644 --- a/tests/Hakyll/Web/Html/Tests.hs +++ b/tests/Hakyll/Web/Html/Tests.hs @@ -59,6 +59,8 @@ tests = testGroup "Hakyll.Web.Html.Tests" $ concat , "." @=? toSiteRoot "index.html" , "." @=? toSiteRoot "/index.html" , "../.." @=? toSiteRoot "foo/bar/qux" + , ".." @=? toSiteRoot "./foo/bar.html" + , ".." @=? toSiteRoot "/foo/./bar.html" ] , fromAssertions "isExternal" From 19788ede4e1ea7ba42974447b0e49b9bf3ff4a86 Mon Sep 17 00:00:00 2001 From: Izzy Cecil Date: Sat, 19 Apr 2014 17:24:27 -0600 Subject: [PATCH 2/5] FIX: `toSiteRoot` no considers "./" to not be relavent. --- src/Hakyll/Web/Html.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Hakyll/Web/Html.hs b/src/Hakyll/Web/Html.hs index f5a7ccc..f29a478 100644 --- a/src/Hakyll/Web/Html.hs +++ b/src/Hakyll/Web/Html.hs @@ -124,6 +124,7 @@ toSiteRoot = emptyException . joinPath . map parent emptyException x = x relevant "." = False relevant "/" = False + relevant "./" = False relevant _ = True From 7e7d193722f1038c6d0b1df81d1401c119f6c503 Mon Sep 17 00:00:00 2001 From: Jyotsna Prakash Date: Fri, 25 Apr 2014 12:36:13 -0700 Subject: [PATCH 3/5] close a missing p tag --- data/example/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/example/index.html b/data/example/index.html index 16a42f9..6dd191d 100644 --- a/data/example/index.html +++ b/data/example/index.html @@ -13,4 +13,4 @@ title: Home

Posts

$partial("templates/post-list.html")$ -

…or you can find more in the archives. +

…or you can find more in the archives.

From b7f7b2ea65e0182494fb3c1182bdc44ea270e181 Mon Sep 17 00:00:00 2001 From: Daniel Mlot Date: Sun, 27 Apr 2014 03:56:00 -0300 Subject: [PATCH 4/5] Add duplode.github.io to examples. --- web/examples.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/examples.markdown b/web/examples.markdown index 9174c1d..e0aac2e 100644 --- a/web/examples.markdown +++ b/web/examples.markdown @@ -85,6 +85,8 @@ this list. This list has no particular ordering. [source](https://github.com/TikhonJelvis/website) - , [source](https://github.com/plaimi/www) +- , + [source](https://github.com/duplode/duplode.github.io/tree/sources) ## Hakyll 3.X From ca44e643a472f7a55fcd8d4deeceebef0679b723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Israel=20Pe=C3=B1a?= Date: Sun, 27 Apr 2014 15:55:33 -0700 Subject: [PATCH 5/5] Minor refactor of PR #233 OS won't change mid-execution, so lets avoid the unnecessary check each time `unixFilter` is run. --- src/Hakyll/Core/UnixFilter.hs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Hakyll/Core/UnixFilter.hs b/src/Hakyll/Core/UnixFilter.hs index fd3c335..edc8eac 100644 --- a/src/Hakyll/Core/UnixFilter.hs +++ b/src/Hakyll/Core/UnixFilter.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE CPP #-} + -------------------------------------------------------------------------------- -- | A Compiler that supports unix filters. module Hakyll.Core.UnixFilter @@ -19,7 +21,6 @@ import System.Exit (ExitCode (..)) import System.IO (Handle, hClose, hFlush, hGetContents, hPutStr, hSetEncoding, localeEncoding) import System.Process -import qualified System.Info as System -------------------------------------------------------------------------------- import Hakyll.Core.Compiler @@ -105,17 +106,19 @@ unixFilterIO :: Monoid o -> i -> IO (o, String, ExitCode) unixFilterIO writer reader programName args input = do - -- The problem on Windows is that `proc` is that it is unable to execute + -- The problem on Windows is that `proc` is unable to execute -- batch stubs (eg. anything created using 'gem install ...') even if its in -- `$PATH`. A solution to this issue is to execute the batch file explicitly -- using `cmd /c batchfile` but there is no rational way to know where said -- batchfile is on the system. Hence, we detect windows using the - -- `System.Info` module and then instead of using `proc` to create the - -- process, use `shell` instead which will be able to execute everything - -- `proc` can, and this can deal with batch files as well. - let pr = if System.os == "mingw32" - then shell $ unwords (programName : args) - else proc programName args + -- CPP and instead of using `proc` to create the process, use `shell` + -- which will be able to execute everything `proc` can + -- as well as batch files. +#ifdef mingw32_HOST_OS + let pr = shell $ unwords (programName : args) +#else + let pr = proc programName args +#endif (Just inh, Just outh, Just errh, pid) <- createProcess pr