def place_in_layouts(content, payload, info)
      output = content.dup
      layout = layouts[document.data["layout"]]

      Bunto.logger.warn(
        "Build Warning:",
        "Layout '#{document.data["layout"]}' requested in "\
        "#{document.relative_path} does not exist."
      ) if invalid_layout? layout

      used = Set.new([layout])

      # Reset the payload layout data to ensure it starts fresh for each page.
      payload["layout"] = nil

      while layout
        payload["content"] = output
        payload["layout"]  = Utils.deep_merge_hashes(layout.data, payload["layout"] || {})

        output = render_liquid(
          layout.content,
          payload,
          info,
          layout.relative_path
        )

        # Add layout to dependency tree
        site.regenerator.add_dependency(
          site.in_source_dir(document.path),
          site.in_source_dir(layout.path)
        ) if document.write?

        if (layout = layouts[layout.data["layout"]])
          break if used.include?(layout)
          used << layout
        end
      end

      output
    end
def place_in_layouts(content, payload, info)
      output = content.dup
      layout = layouts[document.data["layout"]]

      Bunto.logger.warn(
        "Build Warning:",
        "Layout '#{document.data["layout"]}' requested in "\
        "#{document.relative_path} does not exist."
      ) if invalid_layout? layout

      used = Set.new([layout])

      # Reset the payload layout data to ensure it starts fresh for each page.
      payload["layout"] = nil

      while layout
        payload["content"] = output
        payload["layout"]  = Utils.deep_merge_hashes(layout.data, payload["layout"] || {})

        output = render_liquid(
          layout.content,
          payload,
          info,
          layout.relative_path
        )

        # Add layout to dependency tree
        site.regenerator.add_dependency(
          site.in_source_dir(document.path),
          site.in_source_dir(layout.path)
        ) if document.write?

        if (layout = layouts[layout.data["layout"]])
          break if used.include?(layout)
          used << layout
        end
      end

      output
    end
Render layouts and place given content inside.

 content - the content to be placed in the layout


 Returns the content placed in the Liquid-rendered layouts