forked from liamoc/learn-you-an-agda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.hs
35 lines (29 loc) · 1.06 KB
/
main.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/runhaskell
{-# LANGUAGE OverloadedStrings #-}
import Control.Arrow((>>>))
import Hakyll
import Text.Pandoc.Options
compiler = pandocCompilerWith r w >>= relativizeUrls
where r = defaultHakyllReaderOptions
w = defaultHakyllWriterOptions { writerHTMLMathMethod = MathJax "https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js" }
main = hakyll $ do
match "css/*" $ do
route idRoute
compile compressCssCompiler
match "static/*" $ do
route idRoute
compile copyFileCompiler
match "templates/*" $ do
compile templateCompiler
match "pages/*" $ do
route (setExtension "html")
compile $ compiler >>=
loadAndApplyTemplate "templates/default.html" defaultContext
match "toc.md" $ do
route (setExtension "html")
compile $ compiler >>=
loadAndApplyTemplate "templates/toc.html" defaultContext
match "index.md" $ do
route (setExtension "html")
compile $ compiler >>=
loadAndApplyTemplate "templates/cover.html" defaultContext