class Middleman::TemplateContext
def render(_, name, options={}, &block)
def render(_, name, options={}, &block) name = name.to_s partial_file = locate_partial(name, false) || locate_partial(name, true) raise ::Middleman::TemplateRenderer::TemplateNotFound, "Could not locate partial: #{name}" unless partial_file source_path = sitemap.file_to_path(partial_file) r = sitemap.find_resource_by_path(source_path) if (r && !r.template?) || (Tilt[partial_file[:full_path]].nil? && partial_file[:full_path].exist?) partial_file.read else opts = options.dup locs = opts.delete(:locals) render_file(partial_file, locs, opts, &block) end end