From e477ea753b59657ba8d185986c646cc45c66fcec Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sun, 6 Jan 2013 09:58:34 +0100 Subject: Update create/match in example/tutorial --- web/tutorials/03-rules-routes-compilers.markdown | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'web/tutorials/03-rules-routes-compilers.markdown') diff --git a/web/tutorials/03-rules-routes-compilers.markdown b/web/tutorials/03-rules-routes-compilers.markdown index b9e1c61..d587ab4 100644 --- a/web/tutorials/03-rules-routes-compilers.markdown +++ b/web/tutorials/03-rules-routes-compilers.markdown @@ -46,6 +46,25 @@ and all files in the `css/` directory. [Pattern]: /reference/Hakyll-Core-Identifier-Pattern.html +However, we can see that one item makes no use of `match`, but uses `create` +instead. + +```haskell +create ["archive.html"] $ do + route idRoute + compile $ do + ... +``` + +Don't pay attention to the somewhat complicated-looking stuff in `compile` -- +this will become clear soon. The real question here is why we use `create` +instead of `match`. + +The answer is simple: there is no `archive.html` file in our project directory! +So if we were to use `match`, no a file would be matched, and hence, nothing +would appear in the output directory. `create`, however, ensures the items +listed are always produced. + Basic routes ------------ -- cgit v1.2.3