summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2011-04-11 09:07:30 +0200
committerJasper Van der Jeugt <jaspervdj@gmail.com>2011-04-11 09:07:43 +0200
commit9d42e54119ac22915f371597ebd9247a644a605a (patch)
tree76abd63cb6fe9e4f36f3634fa674535584d7604b
parent361b81a2a437568a8495e1e9c0a0aa6ef7a5aa6b (diff)
downloadhakyll-9d42e54119ac22915f371597ebd9247a644a605a.tar.gz
Add note about `copyFileCompiler` in the tutorial
-rw-r--r--examples/hakyll/tutorial.markdown16
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.