jaspervdj/hakyll — pull request #243 by izzycecil (2014-04-19 23:37:20+00:00)
Title: Fix `toSiteRoot` so that it properly deals with "./"

Currently the following tests will fail:
- `".." @=? toSiteRoot "./foo/bar.html"`
- `".." @=? toSiteRoot "/foo/./bar.html"`

This is because `splitPath` splits the file paths like so:
```
splitPath "./foo/bar.html" == ["./", "foo/", "bar.html"]
splitPath "/foo/./bar.html" == ["/", "foo/", "./", "bar.html"]
```
For me, this was a serious problem because `route <- getRoute $ itemIdentifier item` was returning routes that began with "./", so the function `relativizeUrls` did not work properly.

Fixed problem by filtering out "./" from the list generated by `splitPath`.

Let me know if I'm mistaken! I've only been playing with Hakyll for a short while...