blob: a5be5a1355f78d18a2c10eb3fd827395d7cafdb0 (
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
|
{-# LANGUAGE OverloadedStrings #-}
import Data.Monoid (mappend)
import Hakyll
main :: IO ()
main = hakyll $ do
match "design/*.hs" $ do
route $ setExtension "css"
compile $ getResourceString >>= withItemBody (unixFilter "runghc" [])
match "recipes/*" $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/main.html" defaultContext
>>= relativizeUrls
match "index.html" $ do
route idRoute
let context =
listField "recipes" defaultContext (loadAll "recipes/*") `mappend`
defaultContext
compile $
getResourceBody
>>= applyAsTemplate context
>>= loadAndApplyTemplate "templates/main.html" context
>>= relativizeUrls
match "templates/*" $ compile templateBodyCompiler
|