class Jekyll::Document

Monkey patch Jekyll's Document class

Public Class Methods

new(*args) click to toggle source
# File lib/octopress-hooks.rb, line 250
def initialize(*args)
  old_initialize(*args)
  post_init if place_in_layout?
end
Also aliased as: old_initialize

Public Instance Methods

hooks() click to toggle source
# File lib/octopress-hooks.rb, line 261
def hooks
  @hooks ||= site.all_hooks + site.doc_hooks
end
merge_payload(payload) click to toggle source
# File lib/octopress-hooks.rb, line 277
def merge_payload(payload)
  hooks.each do |hook|
    p = hook.merge_payload(payload, self)
    next unless p && p.is_a?(Hash)
    payload = hook.deep_merge_payload(payload, p)
  end
  payload
end
old_initialize(*args)
Alias for: new
old_write(dest)
Alias for: write
post_init() click to toggle source
# File lib/octopress-hooks.rb, line 265
def post_init
  hooks.each do |hook|
    hook.post_init(self)
  end
end
post_render() click to toggle source
# File lib/octopress-hooks.rb, line 286
def post_render
  hooks.each do |hook|
    hook.post_render(self)
  end
end
post_write() click to toggle source
# File lib/octopress-hooks.rb, line 292
def post_write
  hooks.each do |hook|
    hook.post_write(self)
  end
end
pre_render() click to toggle source
# File lib/octopress-hooks.rb, line 271
def pre_render
  hooks.each do |hook|
    hook.pre_render(self)
  end
end
write(dest) click to toggle source
# File lib/octopress-hooks.rb, line 255
def write(dest)
  post_render if place_in_layout?
  old_write(dest)
  post_write if place_in_layout?
end
Also aliased as: old_write