-
Notifications
You must be signed in to change notification settings - Fork 5
/
site.hs
79 lines (70 loc) · 2.51 KB
/
site.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
--------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
import Data.Monoid (mappend)
import Hakyll
--------------------------------------------------------------------------------
main :: IO ()
main = hakyll $ do
match ("images/*" .||. "js/*" .||. "fonts/**") $ do
route idRoute
compile copyFileCompiler
match "css/*" $ do
route idRoute
compile compressCssCompiler
match (fromList [ "about.md"
, "courses.md"
, "links.md"
, "projects.md"
, "students.md"
, "bitcoin.md"
, "zk.md"
]
) $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
match ( "static/courses/**" .||.
"static/bitcoin/**" .||.
"static/monero/**" .||.
"static/ethlab/**" .||.
"static/zk/**" .||.
"static/rust/**" .||.
"static/bellpepper/**" .||.
"static/reports/**" .||.
"static/ee1mtech/**"
) $ do
route $ (gsubRoute "static/" (const ""))
compile copyFileCompiler
match ( "courses/EE706/*.html" .||.
"courses/EE453717/*.html" .||.
"courses/EE605/*.html" .||.
"courses/EE703/*.html" .||.
"courses/EE325/*.html"
) $ do
route idRoute
compile $ do
getResourceBody
>>= applyAsTemplate defaultContext
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
match (
"courses/EE325/*.md" .||.
"courses/EE703/*.md" .||.
"courses/EE605/*.md" .||.
"courses/EE720/*.md" .||.
"courses/EE465/*.md" .||.
"courses/cep/*.md"
) $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
match "index.html" $ do
route idRoute
compile $ do
getResourceBody
>>= applyAsTemplate defaultContext
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
match "templates/*" $ compile templateCompiler