on master help sign in
Update tutorial for YAML object metadata

Since version 4.8 `Metadata` is no longer a Map but a YAML object. (see #225) The compilers tutorial is adapted to use `lookupString` instead of `Map.lookup`.

commit8074252d0cfd3610d03908513eed8c4b0cd2f598 authorFabian Schläpfer <fschlaepfer@users.noreply.github.com> dateTue 29 May 2018, 18:44 (8 years ago) parent1ff0cf4
1 file changed+1−1
web/tutorials/04-compilers.markdown+1−1
web/tutorials/04-compilers.markdown+1−1
@@ -92,7 +92,7 @@ And `$title$` like this:
9292titleContext :: Context a
9393titleContext = field "title" $ \item -> do
9494 metadata <- getMetadata (itemIdentifier item)
95− return $ fromMaybe "No title" $ M.lookup "title" metadata
95+ return $ fromMaybe "No title" $ lookupString "title" metadata
9696```
9797
9898And compose them using the `Monoid` instance: