summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2014-04-21 11:20:56 +0200
committerJasper Van der Jeugt <jaspervdj@gmail.com>2014-04-21 11:20:56 +0200
commit15a9b90988e270ad011d74762caa9a255d839be5 (patch)
treed1d9ea1702565e693b4964c1f84d320f7b75dc51
parent889e6f59f761795af3f2cb83c2a551b9c8478d66 (diff)
parent19788ede4e1ea7ba42974447b0e49b9bf3ff4a86 (diff)
downloadhakyll-15a9b90988e270ad011d74762caa9a255d839be5.tar.gz
Merge pull request #243 from izzycecil/FIX_toSiteRoot
Fix `toSiteRoot` so that it properly deals with "./"
-rw-r--r--src/Hakyll/Web/Html.hs1
-rw-r--r--tests/Hakyll/Web/Html/Tests.hs2
2 files changed, 3 insertions, 0 deletions
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
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"