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缺少樣本。