32 lines
914 B
Haskell
32 lines
914 B
Haskell
|
--------------------------------------------------------------------------------
|
||
|
{-# LANGUAGE OverloadedStrings #-}
|
||
|
import Data.Monoid (mappend)
|
||
|
import Hakyll
|
||
|
|
||
|
|
||
|
--------------------------------------------------------------------------------
|
||
|
main :: IO ()
|
||
|
main = hakyll $ do
|
||
|
match "images/*" $ do
|
||
|
route idRoute
|
||
|
compile copyFileCompiler
|
||
|
|
||
|
match "css/*" $ do
|
||
|
route idRoute
|
||
|
compile compressCssCompiler
|
||
|
|
||
|
match "*.md" $ do
|
||
|
route $ setExtension "html"
|
||
|
compile $ pandocCompiler
|
||
|
>>= loadAndApplyTemplate "templates/default.html" defaultContext
|
||
|
>>= relativizeUrls
|
||
|
|
||
|
match "index.html" $ do
|
||
|
route idRoute
|
||
|
compile $ getResourceBody
|
||
|
>>= loadAndApplyTemplate "templates/default.html" defaultContext
|
||
|
>>= relativizeUrls
|
||
|
|
||
|
match "templates/*" $ compile templateBodyCompiler
|
||
|
|