Class: Octopress::Hooks::Page

Inherits:
Jekyll::Plugin
  • Object
show all
Defined in:
lib/octopress-hooks.rb

Instance Method Summary collapse

Instance Method Details

#deep_merge_payload(page_payload, hook_payload) ⇒ Object

Merges payload with original page payload Allowing merged_payload to return hash fragments, for example: merge_payload can return { awesome => true } and it will be merged into the full payload.

Retuns: a payload that has been deep merged with the original page’s payload



80
81
82
# File 'lib/octopress-hooks.rb', line 80

def deep_merge_payload(page_payload, hook_payload)
  Jekyll::Utils.deep_merge_hashes(page_payload, hook_payload)
end

#merge_payload(payload, page) ⇒ Object

Called right after pre_render hook. Allows you to act on the page’s payload data.

Return: hash to be deep_merged into payload



69
70
71
# File 'lib/octopress-hooks.rb', line 69

def merge_payload(payload, page)
  payload
end

#post_init(page) ⇒ Object

Called after Page is initialized allows you to modify a # page object before it is added to the Jekyll pages array



54
55
# File 'lib/octopress-hooks.rb', line 54

def post_init(page)
end

#post_render(page) ⇒ Object

Called after the post is rendered with the converter. Use the post object to modify it’s contents before the post is inserted into the template.



88
89
# File 'lib/octopress-hooks.rb', line 88

def post_render(page)
end

#post_write(page) ⇒ Object

Called after the post is written to the disk. Use the post object to read it’s contents to do something after the post is safely written.



95
96
# File 'lib/octopress-hooks.rb', line 95

def post_write(page)
end

#pre_render(page) ⇒ Object

Called before post is sent to the converter. Allows you to modify the post object before the converter does it’s thing



61
62
# File 'lib/octopress-hooks.rb', line 61

def pre_render(page)
end