on master help sign in
Merge pull request #243 from izzycecil/FIX_toSiteRoot

Fix `toSiteRoot` so that it properly deals with "./"

commit15a9b90988e270ad011d74762caa9a255d839be5 authorJasper Van der Jeugt <jaspervdj@gmail.com> dateMon 21 Apr 2014, 11:20 (13 years ago) parent889e6f519788ed
2 files changed+3
src/Hakyll/Web/Html.hs+1 tests/Hakyll/Web/Html/Tests.hs+2
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"