aboutsummaryrefslogtreecommitdiff
path: root/site.hs
blob: a02e75dc0ff0e024774f7bd1b17dcd568e626dc0 (plain)
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
{-# LANGUAGE OverloadedStrings #-}

import Hakyll
  ( Configuration(..)
  , compile
  , compressCssCompiler
  , defaultConfiguration
  , defaultContext
  , hakyllWith
  , idRoute
  , loadAndApplyTemplate
  , match
  , pandocCompiler
  , relativizeUrls
  , route
  , setExtension
  , templateBodyCompiler
  )

config :: Configuration
config = defaultConfiguration {deployCommand = "rsync -rv _site/ debnode:portfolio"}

main :: IO ()
main =
  hakyllWith config $ do
    match "index.md" $ do
      route $ setExtension "html"
      compile $ pandocCompiler >>= loadAndApplyTemplate "templates/default.html" defaultContext >>= relativizeUrls
    match "css/*" $ do
      route idRoute
      compile compressCssCompiler
    match "templates/*" $ compile templateBodyCompiler