Hello, I have a bit of a weird site setup, and I'm in a situation where I have a path to something I want to copy into my build directory of my site. I have successfully read the file, but I'm struggling to try and dump the contents into a file. Here's my code:
copyFile :: FilePath -> FilePath -> FilePath -> Rules ()
copyFile from to file = create [fromFilePath $ to </> file] $ do
compile $ do
content <- unsafeCompiler $ readFile (from </> file)
However, when I do this I regularly get the error:
site: /nix/store/86jgml5h1smrppy753xfpq5ip8d1m0ac-thirdparty/mathjax/output/chtml/fonts/woff-v2/MathJax_AMS-Regular.woff: hGetContents: invalid argument (invalid byte sequence)
I suspect this isn't a problem with Hakyll in particular.. however, when I used to have this file as a part of my website's data it would copy it just fine, so maybe there'd be a better way of writing this file. Maybe I should ignore hakyll completely and just use writeFile?