@@ -41,9 +41,11 @@ Templates
42Let's have a look at a simple template:
42Let's have a look at a simple template:
44− <h1>$title$</h1>
45+<h1>$title$</h1>
45− <div class="info">Posted on $date$</div>
46+<div class="info">Posted on $date$</div>
48As you can probably guess, template files just contain text and only the `$`
50As you can probably guess, template files just contain text and only the `$`
49character has special meaning: text between dollar signs ("fields") is replaced
51character has special meaning: text between dollar signs ("fields") is replaced
@@ -53,7 +55,9 @@ use `$$`.
53You usually compile the templates from disk using the aptly named
55You usually compile the templates from disk using the aptly named
54`templateCompiler`:
56`templateCompiler`:
56− match "templates/*" $ compile templateCompiler
59+match "templates/*" $ compile templateCompiler
58Notice the lack of `route` here: this is because we don't need to write the
62Notice the lack of `route` here: this is because we don't need to write the
59templates to your `_site` folder, we just want to use them elsewhere.
63templates to your `_site` folder, we just want to use them elsewhere.
@@ -86,7 +90,7 @@ And `$title$` like this:
88titleContext :: Context a
92titleContext :: Context a
89−titleContext :: field "title" $ \item -> do
93+titleContext = field "title" $ \item -> do
90 metadata <- getMetadata (itemIdentifier item)
94 metadata <- getMetadata (itemIdentifier item)
91 return $ fromMaybe "No title" $ M.lookup "title" metadata
95 return $ fromMaybe "No title" $ M.lookup "title" metadata