jaspervdj / hakyll

A static website compiler library in Haskell
jaspervdj.be/hakyll
Other
2.7k stars 409 forks source link

The latest Hakyll.Web.Feed can not be compiled on Windows. #644

Open Hexirp opened 6 years ago

Hexirp commented 6 years ago

Where there is a problem:

https://github.com/jaspervdj/hakyll/blob/1abdeee743d65d96c6f469213ca6e7ea823340a7/lib/Hakyll/Web/Feed.hs#L44-L58

Problem:

    C:\(private info)\hakyll\lib\Hakyll\Web\Feed.hs:46:18: error:
        ? Exception when trying to run compile-time code:
            C:\(private info)\hakyll\data/templates/rss.xml: openBinaryFile: does not exist (No such file or directory)
          Code: makeRelativeToProject "data/templates/rss.xml" >>= embedFile
        ? In the untyped splice:
            $(makeRelativeToProject "data/templates/rss.xml" >>= embedFile)
       |
    46 |     T.decodeUtf8 $(makeRelativeToProject "data/templates/rss.xml" >>= embedFile)
       |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This line causes this kind of error in Windows. I want to do a workaround: change the path with CPP. If you do not mind, I will send a pull request.

jaspervdj commented 6 years ago

I would happy to get a PR for this, thank you!