@@ -77,7 +77,11 @@ directory as illustrated in this diagram:
77
77
79No magic is involved at all -- we will precisely study how and why our items are
79No magic is involved at all -- we will precisely study how and why our items are
80−compiled like that. All of this is specified in the `hakyll.hs` file.
80+compiled like that. All of this is specified in the `hakyll.hs` file. You can
81+view the full `hakyll.hs` file online [here][brochure-hakyll.hs], or you can
82+look in the directory you cloned or downloaded.
84+[brochure-hakyll.hs]: http://github.com/jaspervdj/hakyll-examples/blob/master/brochure/hakyll.hs
@@ -182,6 +186,14 @@ of the content *field* by using `$field$`, and that's it.
182You might have noticed how we specify a compiler (`compile`), but we don't set
186You might have noticed how we specify a compiler (`compile`), but we don't set
183any `route`. Why is this?
187any `route`. Why is this?
189+We need to compile the template because we will need it later. If we compile a
190+page later using `templates/default.html`, Hakyll needs to know what
191+`templates/default.html` is. Note that we could move template compilation to the
192+bottom of our code. The order doesn't matter -- Hakyll will determine that for
193+you. But if you don't compile `templates/default.html` as a template, Hakyll
194+will not be able to take it into account when deciding the compilation order.
196+So, the `compile` needs to be there -- but why don't we set a `route` here?
185Precisely because we don't want to our template to end up anywhere in our site
197Precisely because we don't want to our template to end up anywhere in our site
186directory! We want to use it to lay out other items -- so we need to load
198directory! We want to use it to lay out other items -- so we need to load
187(compile) it, but we don't want to give it a real destination.
199(compile) it, but we don't want to give it a real destination.
@@ -294,9 +306,22 @@ absolute URL's everywhere in our templates and code, e.g.:
294<link rel="stylesheet" type="text/css" href="/css/default.css" />
306<link rel="stylesheet" type="text/css" href="/css/default.css" />
309+Using the [relativizeUrlsCompiler], Hakyll will change this to:
312+<link rel="stylesheet" type="text/css" href="css/default.css" />
315+when we are compiling `index.html`, or
318+<link rel="stylesheet" type="text/css" href="../css/default.css" />
321+when we are compiling (some imaginary) `posts/foo.html`. So Hakyll will
297−And Hakyll will translate this to a relative URL for each page. This means we
322+translate this to a relative URL for each page. This means we can host our site
298−can host our site at `example.com` and `example.com/subdir` without changing a
323+at `example.com` and `example.com/subdir` without changing a single line of
299−single line of code.
324+code.
301More tutorials are in the works...
326More tutorials are in the works...