Skip to content
Browse files

Adding information about config argument to hooks

  • Loading branch information...
1 parent a3d9853 commit 8af0454dc8971ce9fedd7f78dd9359112e660b08 @jgoodson jgoodson committed Mar 8, 2013
Showing with 36 additions and 12 deletions.
  1. +36 −12 docs/content/docs/hooks.mkd
View
48 docs/content/docs/hooks.mkd
@@ -68,33 +68,43 @@ will pass to the hooked functions (if any.)
<!-- This first one needs to be wrapped in a p tag, because it doesn't happen automatically for some reason...? -->
-`site.start()` <a name="site.start"> </a>
+`site.start(config)` <a name="site.start"> </a>
+: `config`
+ : Dictionary containing site configuration
: <p>Called before anything else has started, except for the loading of hooks.
This would be a good time to modify the content, templates, or the files in
the media directory.</p>
-`site.output.pre(output_path)` <a name="site.output.pre"> </a>
+`site.output.pre(config, output_path)` <a name="site.output.pre"> </a>
+: `config`
+ : Dictionary containing site configuration
: `output_path`
: The path to the output directory.
: This path will run before the output directory is populated by the media,
and after any existing output files have been deleted. You can add files
that may be overwritten by the media files or the site content.
-`site.output.post(output_path)` <a name="site.output.post"> </a>
+`site.output.post(config, output_path)` <a name="site.output.post"> </a>
+: `config`
+ : Dictionary containing site configuration
: `output_path`
: The path to the output directory.
: This hook will run after the output directory is populated by the media,
and before the content pages have started to be processed. You can use this
to modify, overwrite, or otherwise fiddle with the media directory after it
has been copied to the output directory.
-`site.content.gather.pre()` <a name="site.content.gather.pre"> </a>
+`site.content.gather.pre(config)` <a name="site.content.gather.pre"> </a>
+: `config`
+ : Dictionary containing site configuration
: Return value
: List of `Page` objects to add to the list of pages.
: This hook will run before wok gathers content pages, and can be used to add
pages that don't exist on disk.
-`site.content.gather.post(pages)` <a name="site.content.gather.post"> </a>
+`site.content.gather.post(config, pages)` <a name="site.content.gather.post"> </a>
+: `config`
+ : Dictionary containing site configuration
: `pages`
: The list of pages that wok has gathered from the content directory, and
any other hooks that have run. Also includes the duplicated versions of
@@ -106,7 +116,9 @@ will pass to the hooked functions (if any.)
you modify the list of pages received, those changes will take effect in
wok. You may also return pages to add.
-`page.render.pre(page)` <a name="page.render.pre"> </a>
+`page.render.pre(config, page)` <a name="page.render.pre"> </a>
+: `config`
+ : Dictionary containing site configuration
: `page`
: The current page object that is being processed.
: This hook will be called for each page before the page is rendered by
@@ -115,7 +127,9 @@ will pass to the hooked functions (if any.)
some pages won't be run through this hook because they come from other
sources, such as hooks, or pagination.
-`page.render.post(page)` <a name="page.render.post"> </a>
+`page.render.post(config, page)` <a name="page.render.post"> </a>
+: `config`
+ : Dictionary containing site configuration
: `page`
: The current page object that is being processed.
: This hook will be called for each page right after the page is rendered by
@@ -125,20 +139,26 @@ will pass to the hooked functions (if any.)
through this hook because they come from other sources, such as hooks, or
pagination.
-`page.meta.pre(page)` <a name="page.render.pre"> </a>
+`page.meta.pre(config, page)` <a name="page.render.pre"> </a>
+: `config`
+ : Dictionary containing site configuration
: `page`
: The current page object that is being processed.
: This hook will be called for each page before the page has it's meta data
filled in. Some metadata will exist, but it will be in an unnormalized
state.
-`page.meta.post(page)` <a name="page.render.post"> </a>
+`page.meta.post(config, page)` <a name="page.render.post"> </a>
+: `config`
+ : Dictionary containing site configuration
: `page`
: The current page object that is being processed.
: This hook will be called for each page right after the page has it's meta
data filled in and normalized.
-`page.template.pre(page, templ_vars)` <a name="page.template.pre"> </a>
+`page.template.pre(config, page, templ_vars)` <a name="page.template.pre"> </a>
+: `config`
+ : Dictionary containing site configuration
: `page`
: The current page object that is being processed.
: `templ_vars`
@@ -154,14 +174,18 @@ will pass to the hooked functions (if any.)
[templates]: /docs/templates/
-`page.template.post(page)` <a name="page.template.postpage"> </a>
+`page.template.post(config, page)` <a name="page.template.postpage"> </a>
+: `config`
+ : Dictionary containing site configuration
: `page`
: The current page being processed.
: This hook will be called after the page has been processed by the template
engine. The next step will be write the file to disk, if applicable, so any
last minute changes should happen here.
-`site.done()` <a name="site.done"> </a>
+`site.done(config)` <a name="site.done"> </a>
+: `config`
+ : Dictionary containing site configuration
: Called after wok has finished everything. This would be a good time to make
any general modifications to the output, or to do something like upload the
site for distribution. If the `--server` option has been specified, this

0 comments on commit 8af0454

Please sign in to comment.
Something went wrong with that request. Please try again.