class Middleman::Sitemap::Resource
def render(opts={}, locs={}, &block)
-
(String)
-
def render(opts={}, locs={}, &block) if !template? return app.template_data_for_file(source_file) end relative_source = Pathname(source_file).relative_path_from(Pathname(app.root)) instrument "render.resource", :path => relative_source do md = metadata.dup opts = md[:options].deep_merge(opts) locs = md[:locals].deep_merge(locs) # Forward remaining data to helpers if md.has_key?(:page) app.data.store("page", md[:page]) end blocks = md[:blocks].dup rescue [] blocks << block if block_given? app.current_path ||= self.destination_path app.render_template(source_file, locs, opts, blocks) end end