diff options
-rw-r--r-- | examples/hakyll/tutorial.markdown | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/examples/hakyll/tutorial.markdown b/examples/hakyll/tutorial.markdown index 5c8a0c0..96d85c5 100644 --- a/examples/hakyll/tutorial.markdown +++ b/examples/hakyll/tutorial.markdown @@ -69,6 +69,10 @@ main = hakyll $ do route idRoute compile compressCssCompiler + match "images/*" $ do + route idRoute + compile copyFileCompiler + match "templates/*" $ compile templateCompiler forM_ ["about.rst", "index.markdown", "code.lhs"] $ \page -> @@ -148,6 +152,18 @@ the CSS found in the files. compile compressCssCompiler ~~~~~ +We can compile our images in a similar way. We use `idRoute` again, but we don't +want to change anything -- so we use `copyFileCompiler`. The difference between +most other compilers and `copyFileCompiler` is that the lattern will *not* +attempt to read the file: it will copy the file directly, so it supports large +binary files as well. + +~~~~~{.haskell} +match "images/*" $ do + route idRoute + compile copyFileCompiler +~~~~~ + Next, we're going to render some pages. We're going to style the results a little, so we're going to need a [Template]. We simply compile a template using the `templateCompiler` compiler, it's good enough in most cases. |