on master help sign in
Add note about `copyFileCompiler` in the tutorial
9d42e54Jasper Van der Jeugt
examples/hakyll/tutorial.markdown+16
@@ -69,6 +69,10 @@ main = hakyll $ do
69 route idRoute
69 route idRoute
70 compile compressCssCompiler
70 compile compressCssCompiler
71
71
72+ match "images/*" $ do
73+ route idRoute
74+ compile copyFileCompiler
75+
72 match "templates/*" $ compile templateCompiler
76 match "templates/*" $ compile templateCompiler
73
77
74 forM_ ["about.rst", "index.markdown", "code.lhs"] $ \page ->
78 forM_ ["about.rst", "index.markdown", "code.lhs"] $ \page ->
@@ -148,6 +152,18 @@ the CSS found in the files.
148compile compressCssCompiler
152compile compressCssCompiler
149~~~~~
153~~~~~
150
154
155+We can compile our images in a similar way. We use `idRoute` again, but we don't
156+want to change anything -- so we use `copyFileCompiler`. The difference between
157+most other compilers and `copyFileCompiler` is that the lattern will *not*
158+attempt to read the file: it will copy the file directly, so it supports large
159+binary files as well.
160+
161+~~~~~{.haskell}
162+match "images/*" $ do
163+ route idRoute
164+ compile copyFileCompiler
165+~~~~~
166+
151Next, we're going to render some pages. We're going to style the results a
167Next, we're going to render some pages. We're going to style the results a
152little, so we're going to need a [Template]. We simply compile a template using
168little, so we're going to need a [Template]. We simply compile a template using
153the `templateCompiler` compiler, it's good enough in most cases.
169the `templateCompiler` compiler, it's good enough in most cases.