我想匹配带有扩展名*.md
和目录*.tex
的posts
文件。
我不能使用的原因"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
,但我不知道如何为此编写正则表达式。
非常欢迎添加学习资源。文档缺少样本。