on master help sign in
Add section on default/global values.
commit1ad5314581a65bdf278317840c3e198c2abc7d97 authorJasper Van der Jeugt <jaspervdj@gmail.com> dateThu 17 Jun 2010, 17:56 (16 years ago) parent1b73752
1 file changed+15
examples/hakyll/tutorials/part07.markdown+15
examples/hakyll/tutorials/part07.markdown+15
@@ -78,3 +78,18 @@ The benefit of this is simply prettier URL's. That is, if you consider
7878- Auto-compilation is handy, but a rebuild is recommended before deploying your
7979 site.
8080- You can enable pretty URL's in Hakyll. It is, however, not the default.
81+
82+## Default values
83+
84+At some point, you might want to use a number of global key-value pairs, for
85+example, `$author`. There are two possible ways to achieve this.
86+
87+- There is an option in `HakyllConfiguration` supporting this, called
88+ `additionalContext`. For an example on how to use `HakyllConfiguration`, see
89+ the pretty URL's section above.
90+
91+- Another option is to use a `defaults.markdown` file, simply containing some
92+ metadata, and then `combine` this file with other pages. The advantage is
93+ that autocompilation mode will pick up changes in this file[^1].
94+
95+[^1]: Original idea by zenzike.