{-# LANGUAGE OverloadedStrings #-} import Data.Maybe (fromMaybe) import qualified GHC.IO.Encoding as E import Hakyll import Hakyll.Process main :: IO () main = do E.setLocaleEncoding E.utf8 hakyll $ do match "templates/*" $ compile templateBodyCompiler match "services-info.md" $ do route $ setExtension "html" compile $ pandocCompiler >>= loadAndApplyTemplate "templates/services-info.html" defaultContext match ("*.md" .&&. complement "services-info.md") $ do route $ setExtension "html" compile $ pandocCompiler >>= loadAndApplyTemplate "templates/default.html" defaultContext match "*.elm" $ do route $ setExtension "js" compile $ execCompilerWith (execName "elm") [ProcArg "make", HakFilePath, ProcArg "--output=main.js"] (COutFile $ SpecificPath "main.js")