def do_layout(payload, layouts)
      pre_render if respond_to?(:pre_render) && hooks

      if respond_to?(:merge_payload) && hooks
        old_do_layout(merge_payload(payload.dup), layouts)
      else
        old_do_layout(payload, layouts)
      end

      post_render if respond_to?(:post_render) && hooks
    end
def do_layout(payload, layouts)
      pre_render if respond_to?(:pre_render) && hooks

      if respond_to?(:merge_payload) && hooks
        old_do_layout(merge_payload(payload.dup), layouts)
      else
        old_do_layout(payload, layouts)
      end

      post_render if respond_to?(:post_render) && hooks
    end
Calls the pre_render method if it exists and then adds any necessary
 layouts to this convertible document.

 payload - The site payload Hash.
 layouts - A Hash of {"name" => "layout"}.

 Returns nothing.