summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-06-17 17:56:05 +0200
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-06-17 17:56:05 +0200
commit1ad5314581a65bdf278317840c3e198c2abc7d97 (patch)
treefdda9e32fc5115a3ccade51e01ddacc490bd856a
parent1b73752de3b6a4111ff4156d41bec571864ad42a (diff)
downloadhakyll-1ad5314581a65bdf278317840c3e198c2abc7d97.tar.gz
Add section on default/global values.
-rw-r--r--examples/hakyll/tutorials/part07.markdown15
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/hakyll/tutorials/part07.markdown b/examples/hakyll/tutorials/part07.markdown
index e5a385c..539dbea 100644
--- a/examples/hakyll/tutorials/part07.markdown
+++ b/examples/hakyll/tutorials/part07.markdown
@@ -78,3 +78,18 @@ The benefit of this is simply prettier URL's. That is, if you consider
- Auto-compilation is handy, but a rebuild is recommended before deploying your
site.
- You can enable pretty URL's in Hakyll. It is, however, not the default.
+
+## Default values
+
+At some point, you might want to use a number of global key-value pairs, for
+example, `$author`. There are two possible ways to achieve this.
+
+- There is an option in `HakyllConfiguration` supporting this, called
+ `additionalContext`. For an example on how to use `HakyllConfiguration`, see
+ the pretty URL's section above.
+
+- Another option is to use a `defaults.markdown` file, simply containing some
+ metadata, and then `combine` this file with other pages. The advantage is
+ that autocompilation mode will pick up changes in this file[^1].
+
+[^1]: Original idea by zenzike.