0
我想匹配posts
目录中扩展名为*.md
和*.tex
的文件。如何结合多个模式进行匹配?
我不能使用"posts/*" :: Pattern
的原因是因为帖子目录中有文件*.tex.metadata
。而site
会给这个文件带来错误。
[ERROR] Hakyll.Web.readPandocWith: I don't know how to read a file of the type Binary for: posts/2017-06-02-tex.metadata
尝试下面的代码,并失败,空匹配(无html输出)。
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
也许我应该用fromRegex
,但我不知道如何编写正则表达式这一点。
加入学习资源非常受欢迎。 documentation缺少样本。