jackkelly-name/bin/Main.hs -rw-r--r-- 1.5 KiB View raw
                                                                                
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
import Blog (blog)
import Blog.Posts (blogPostCompiler)
import Data.Default (def)
import GHC.IO.Encoding (setLocaleEncoding, utf8)
import Hakyll
import Navigation (navigationContext, navigation)
import Site (baseSiteContext, sectionLabel)
import Talks (talks)

main :: IO ()
main = do
  setLocaleEncoding utf8
  let config = def
        { destinationDirectory = "_out"
        , providerDirectory = "content"
        }

  hakyllWith config $ do
    create ["index.html"] $ do
      let context = mconcat
            [ constField "title" $ sectionLabel []
            , navigationContext navigation
            , baseSiteContext
            ]
      route idRoute
      compile $ makeItem ""
        >>= loadAndApplyTemplate "templates/default.html" context
        >>= relativizeUrls

    blog
    talks

    -- Temp
    match "garagesale.md" $ do
      let context = mconcat
            [ constField "title" $ sectionLabel ["Garage Sale"]
            , navigationContext navigation
            , baseSiteContext
            ]
      route $ constRoute "garagesale/index.html"
      compile $
        blogPostCompiler
          >>= loadAndApplyTemplate "templates/_panel.html" context
          >>= loadAndApplyTemplate "templates/default.html" context
          >>= relativizeUrls

    match "images/**" $ do
      route idRoute
      compile copyFileCompiler

    match "css/*" $ do
      route idRoute
      compile copyFileCompiler

    match "templates/**" $ compile templateCompiler