Issue #4 resolved

Windows support broken

Anonymous created an issue

As described in the other thread, Windows support seems broken. Files with a destination in a subdir of _site are not created. This includes posts, assets, and subpages.

Comments (6)

  1. Anonymous

    From looking over the source code, I see many hardcoded Unix-style path handling. I imagine a more thorough use of os.path will solve the problem (os.path.sep in particular, instead of the slashes).

  2. Andrey Vlasovskikh repo owner

    I don't have access to a Windows box, so I need some help here. You could start with path2url and url2path functions. Feel free to ask for help in debugging this problem.

  3. Anonymous

    I debugged it successfully. Here are the changes:

    def path2url(path):
        m = re.match('(.*)'+os.path.sep+'index.html?$', path)
        if m:
            path = ('{0}'+os.path.sep).format(
        return pathname2url((os.path.sep+'{0}').format(path))
    def url2path(url):
        if url.endswith('/'):
            url += 'index.html'
        return url2pathname(url).lstrip(os.path.sep)

    I tried to convert the internal representation also to os.path.sep, by changing if url.endswith() and the permalinks, but that didn't work out. The url.endswith didn't work for unclear reasons causing any index.html to be not created. Windows accept the '/' as a file separator (only when accessing, when listing it still returns the '\'), so I think this is now a proper solution. It works anyway. I hope you can quickly push this to a .1 release ;)

  4. Log in to comment