@@ -1,13 +1,18 @@
1−import Text.Hakyll (hakyll)
2−import Text.Hakyll.File (directory)
3−import Text.Hakyll.Render (css, static, renderChain)
4−import Text.Hakyll.CreateContext (createPage)
5−
6−main = hakyll "http://example.com" $ do
7− directory css "css"
8− render "about.rst"
9− render "index.markdown"
10− render "code.lhs"
11− where
12− render = renderChain ["templates/default.html"]
13− . createPage
1+{-# LANGUAGE OverloadedStrings #-}
2+import Control.Arrow ((>>>))
3+import Control.Monad (forM_)
4+
5+import Hakyll
6+
7+main :: IO ()
8+main = hakyll $ do
9+ route "css/*" idRoute
10+ compile "css/*" defaultCompressCss
11+
12+ compile "templates/*" defaultTemplateRead
13+
14+ forM_ ["about.rst", "index.markdown", "code.lhs"] $ \page -> do
15+ route page $ setExtension "html"
16+ compile page $ defaultPageRead
17+ >>> require "templates/default.html" (flip applyTemplate)
18+ >>> defaultRelativizeUrls