From f08b2222ca756e8311c70862c8c753da007b6917 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Thu, 10 Feb 2011 12:29:40 +0100 Subject: Update brochure example to hakyll3 --- examples/brochure/hakyll.hs | 31 ++++++++++++++++++------------- examples/brochure/templates/default.html | 16 ++++++++-------- 2 files changed, 26 insertions(+), 21 deletions(-) (limited to 'examples') diff --git a/examples/brochure/hakyll.hs b/examples/brochure/hakyll.hs index a74bee1..e84f14c 100644 --- a/examples/brochure/hakyll.hs +++ b/examples/brochure/hakyll.hs @@ -1,13 +1,18 @@ -import Text.Hakyll (hakyll) -import Text.Hakyll.File (directory) -import Text.Hakyll.Render (css, static, renderChain) -import Text.Hakyll.CreateContext (createPage) - -main = hakyll "http://example.com" $ do - directory css "css" - render "about.rst" - render "index.markdown" - render "code.lhs" - where - render = renderChain ["templates/default.html"] - . createPage +{-# LANGUAGE OverloadedStrings #-} +import Control.Arrow ((>>>)) +import Control.Monad (forM_) + +import Hakyll + +main :: IO () +main = hakyll $ do + route "css/*" idRoute + compile "css/*" defaultCompressCss + + compile "templates/*" defaultTemplateRead + + forM_ ["about.rst", "index.markdown", "code.lhs"] $ \page -> do + route page $ setExtension "html" + compile page $ defaultPageRead + >>> require "templates/default.html" (flip applyTemplate) + >>> defaultRelativizeUrls diff --git a/examples/brochure/templates/default.html b/examples/brochure/templates/default.html index 794d449..8fb75cb 100644 --- a/examples/brochure/templates/default.html +++ b/examples/brochure/templates/default.html @@ -4,18 +4,18 @@ - MyAweSomeCompany - $title - - + MyAweSomeCompany - $title$ + + -

MyAweSomeCompany - $title

+

MyAweSomeCompany - $title$

- $body + $body$ -- cgit v1.2.3