~jack/jackkelly-name

ref: 8de6f1521045b2fbc086cb30d9fc901d7170ab5a jackkelly-name/bin/Main.hs -rw-r--r-- 863 bytes
8de6f152Jack Kelly Import site code from unified repo 2 years ago
                                                                                
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
import Blog (blog)
import Data.Default (def)
import GHC.IO.Encoding (setLocaleEncoding, utf8)
import Hakyll
import Navigation (navigationContext, navigation)
import Site (baseSiteContext, sectionLabel)

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

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

    match "templates/**" $ compile templateCompiler