Update tutorial draft
This commit is contained in:
parent
4586e7bb3d
commit
768b180176
1 changed files with 11 additions and 11 deletions
|
@ -66,15 +66,15 @@ import Hakyll
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = hakyll $ do
|
main = hakyll $ do
|
||||||
route "css/*" idRoute
|
route "css/*" idRoute
|
||||||
compile "css/*" defaultCompressCss
|
compile "css/*" compressCssCompiler
|
||||||
|
|
||||||
compile "templates/*" defaultTemplateRead
|
compile "templates/*" templateCompiler
|
||||||
|
|
||||||
forM_ ["about.rst", "index.markdown", "code.lhs"] $ \page -> do
|
forM_ ["about.rst", "index.markdown", "code.lhs"] $ \page -> do
|
||||||
route page $ setExtension "html"
|
route page $ setExtension "html"
|
||||||
compile page $ defaultPageRead
|
compile page $ readPageCompiler
|
||||||
>>> defaultApplyTemplate "templates/default.html"
|
>>> applyTemplateCompiler "templates/default.html"
|
||||||
>>> defaultRelativizeUrls
|
>>> relativizeUrlsCompiler
|
||||||
~~~~~
|
~~~~~
|
||||||
|
|
||||||
This is enough code to create a small brochure site! You can find all code
|
This is enough code to create a small brochure site! You can find all code
|
||||||
|
@ -122,11 +122,11 @@ Apart from specifying where the items should go (using `route`), we also have to
|
||||||
specify *how* the need to be compiled. This is done using the `compile`
|
specify *how* the need to be compiled. This is done using the `compile`
|
||||||
function. As second argument, it takes a `Compiler`. These compilers can consist
|
function. As second argument, it takes a `Compiler`. These compilers can consist
|
||||||
of very complicated constructions, but Hakyll also provides a number of good
|
of very complicated constructions, but Hakyll also provides a number of good
|
||||||
default compilers. The `defaultCompressCss` compiler will simply compress the
|
default compilers. The `compressCssCompiler` compiler will simply compress the
|
||||||
CSS found in the files.
|
CSS found in the files.
|
||||||
|
|
||||||
~~~~~{.haskell}
|
~~~~~{.haskell}
|
||||||
compile "css/*" defaultCompressCss
|
compile "css/*" compressCssCompiler
|
||||||
~~~~~
|
~~~~~
|
||||||
|
|
||||||
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
|
||||||
|
@ -139,7 +139,7 @@ We don't use a route for these templates, after all, we don't want to route them
|
||||||
anywhere, we just want to use them to style our pages a little.
|
anywhere, we just want to use them to style our pages a little.
|
||||||
|
|
||||||
~~~~~{.haskell}
|
~~~~~{.haskell}
|
||||||
compile "templates/*" defaultTemplateRead
|
compile "templates/*" templateCompiler
|
||||||
~~~~~
|
~~~~~
|
||||||
|
|
||||||
We can conclude that some rules do not *directly* add an output page on our
|
We can conclude that some rules do not *directly* add an output page on our
|
||||||
|
@ -175,7 +175,7 @@ reference page has some more information on this subject.
|
||||||
[compiler]: /reference/Hakyll-Core-Compiler.html
|
[compiler]: /reference/Hakyll-Core-Compiler.html
|
||||||
|
|
||||||
~~~~~{.haskell}
|
~~~~~{.haskell}
|
||||||
compile page $ defaultPageRead
|
compile page $ pageCompiler
|
||||||
>>> defaultApplyTemplate "templates/default.html"
|
>>> applyTemplateCompiler "templates/default.html"
|
||||||
>>> defaultRelativizeUrls
|
>>> relativizeUrlsCompiler
|
||||||
~~~~~
|
~~~~~
|
||||||
|
|
Loading…
Reference in a new issue