Add note about copyFileCompiler
in the tutorial
This commit is contained in:
parent
361b81a2a4
commit
9d42e54119
1 changed files with 16 additions and 0 deletions
|
@ -69,6 +69,10 @@ main = hakyll $ do
|
||||||
route idRoute
|
route idRoute
|
||||||
compile compressCssCompiler
|
compile compressCssCompiler
|
||||||
|
|
||||||
|
match "images/*" $ do
|
||||||
|
route idRoute
|
||||||
|
compile copyFileCompiler
|
||||||
|
|
||||||
match "templates/*" $ compile templateCompiler
|
match "templates/*" $ compile templateCompiler
|
||||||
|
|
||||||
forM_ ["about.rst", "index.markdown", "code.lhs"] $ \page ->
|
forM_ ["about.rst", "index.markdown", "code.lhs"] $ \page ->
|
||||||
|
@ -148,6 +152,18 @@ the CSS found in the files.
|
||||||
compile compressCssCompiler
|
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
|
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
|
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.
|
the `templateCompiler` compiler, it's good enough in most cases.
|
||||||
|
|
Loading…
Reference in a new issue