diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2013-01-06 09:58:34 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2013-01-06 09:58:34 +0100 |
commit | e477ea753b59657ba8d185986c646cc45c66fcec (patch) | |
tree | c4d9b12ddbe54a232a1dbb4c641846c27f88f8b6 /web/tutorials/03-rules-routes-compilers.markdown | |
parent | 18b6ac5ad42e50e75b9ee9fcfc8aef00f5a00957 (diff) | |
download | hakyll-e477ea753b59657ba8d185986c646cc45c66fcec.tar.gz |
Update create/match in example/tutorial
Diffstat (limited to 'web/tutorials/03-rules-routes-compilers.markdown')
-rw-r--r-- | web/tutorials/03-rules-routes-compilers.markdown | 19 |
1 files changed, 19 insertions, 0 deletions
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 ------------ |