Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

align hooks documentation and implementation #4104

Merged
merged 1 commit into from Nov 4, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/jekyll/hooks.rb
Expand Up @@ -15,6 +15,7 @@ module Hooks
after_reset: [],
post_read: [],
pre_render: [],
post_render: [],
post_write: [],
},
:pages => {
Expand All @@ -30,6 +31,7 @@ module Hooks
post_write: [],
},
:documents => {
post_init: [],
pre_render: [],
post_render: [],
post_write: [],
Expand Down
2 changes: 2 additions & 0 deletions lib/jekyll/site.rb
Expand Up @@ -179,6 +179,8 @@ def render
page.render(layouts, payload)
end
end

Jekyll::Hooks.trigger :site, :post_render, self, payload
rescue Errno::ENOENT
# ignore missing layout dir
end
Expand Down
13 changes: 12 additions & 1 deletion site/_docs/plugins.md
Expand Up @@ -491,7 +491,7 @@ custom functionality every time Jekyll renders a post, you could register a
hook like this:

{% highlight ruby %}
Jekyll::Hooks.register :post, :post_render do |post|
Jekyll::Hooks.register :posts, :post_render do |post|
# code to call after Jekyll renders a post
end
{% endhighlight %}
Expand Down Expand Up @@ -526,6 +526,17 @@ The complete list of available hooks is below:
<p>Just after site reset</p>
</td>
</tr>
<tr>
<td>
<p><code>:site</code></p>
</td>
<td>
<p><code>:post_read</code></p>
</td>
<td>
<p>After site data has been read and loaded from disk</p>
</td>
</tr>
<tr>
<td>
<p><code>:site</code></p>
Expand Down