diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2013-01-24 09:19:00 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2013-01-24 09:19:00 +0100 |
commit | 7e4ca6f271b6ae5dd50503e00eea0f4a35a608eb (patch) | |
tree | e327a8ad3e0e164b55dbd040731adc71841672b1 /web/tutorials/04-compilers.markdown | |
parent | dbd670c3dcd27ad8099f7e1927bf176c33490b0f (diff) | |
download | hakyll-7e4ca6f271b6ae5dd50503e00eea0f4a35a608eb.tar.gz |
Typo & syntax highlighting fixes in tutorial 4
Diffstat (limited to 'web/tutorials/04-compilers.markdown')
-rw-r--r-- | web/tutorials/04-compilers.markdown | 14 |
1 files changed, 9 insertions, 5 deletions
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: - <h1>$title$</h1> - <div class="info">Posted on $date$</div> - $body$ +```html +<h1>$title$</h1> +<div class="info">Posted on $date$</div> +$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 ``` |