getpelican/pelican — pull request #1489 by bugnano (2014-10-03 12:22:41+00:00)
Title: Fix using {filename} on Windows

Python on Windows uses the '\\' character for paths on os.path functions, while on source files usually the '/' character is used to separate paths.

self._context['filenames'] has the file names separated by '\\' on Windows, so if a source file references a file with

```
{filename}/dir1/dir2/referenced_file.rst
```

this would fail, as self._context['filenames'] has this file mapped to `dir1\dir2\referenced_file.rst`

This patch solves the problem in an os-portable way, that is it separates the source path '/' characters, and it replaces them with the correct os-dependent path separator, so it works both on Windows and on Linux.