From 7e4ca6f271b6ae5dd50503e00eea0f4a35a608eb Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Thu, 24 Jan 2013 09:19:00 +0100 Subject: Typo & syntax highlighting fixes in tutorial 4 --- web/tutorials/04-compilers.markdown | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'web/tutorials/04-compilers.markdown') diff --git a/web/tutorials/04-compilers.markdown b/web/tutorials/04-compilers.markdown index ef2877b..522f817 100644 --- a/web/tutorials/04-compilers.markdown +++ b/web/tutorials/04-compilers.markdown @@ -41,9 +41,11 @@ Templates Let's have a look at a simple template: -

$title$

-
Posted on $date$
- $body$ +```html +

$title$

+
Posted on $date$
+$body$ +``` As you can probably guess, template files just contain text and only the `$` character has special meaning: text between dollar signs ("fields") is replaced @@ -53,7 +55,9 @@ use `$$`. You usually compile the templates from disk using the aptly named `templateCompiler`: - match "templates/*" $ compile templateCompiler +```haskell +match "templates/*" $ compile templateCompiler +``` Notice the lack of `route` here: this is because we don't need to write the templates to your `_site` folder, we just want to use them elsewhere. @@ -86,7 +90,7 @@ And `$title$` like this: ```haskell titleContext :: Context a -titleContext :: field "title" $ \item -> do +titleContext = field "title" $ \item -> do metadata <- getMetadata (itemIdentifier item) return $ fromMaybe "No title" $ M.lookup "title" metadata ``` -- cgit v1.2.3