I want to match files with extensions *.md
and *.tex
in posts
directory.
The reason I can't use "posts/*" :: Pattern
is because there are files *.tex.metadata
in the posts directory. And site
will give error on that files.
[ERROR] Hakyll.Web.readPandocWith: I don't know how to read a file of the type Binary for: posts/2017-06-02-tex.metadata
Try following code and fail with empty match (no html output).
match (fromList ["posts/*.md", "posts/*.tex"]) $ do
route $ setExtension "html"
compile $ pandocCompiler
let postFiles :: Pattern
postFiles = fromGlob "posts/*.md" `mappend` fromGlob "posts/*.tex"
match postFiles $ do
route $ setExtension "html"
compile $ pandocCompiler
Maybe I should use fromRegex
but I have no idea how to write regex for that.
Addition learning resource is very much welcome. The documentation is lack of sample.