lib/middlemac/private.rb
#--------------------------------------------------------
# Provide a complete path to our version of the `partial`
# helper that checks for the existence of the requested
# partial in the following locations, in order:
#
# - The localized assets directory.
# - The partials_dir specified in options.
# - The inherited behavior.
#
# @param [Sitemap::Resource] resource The resource that
#   is requesting the partial.
# @param [String] template The name of the partial this
#   is being requested.
#
# @!visibility private
#--------------------------------------------------------
Provide a complete path to our version of the `partial`
helper that checks for the existence of the requested
partial in the following locations, in order.

The localized assets directory.
The partials_dir specified in options.
The inherited behavior.
Provide a complete path to our version of the ` partial ` helper that checks for the existence of the requested partial in the following locations in order . The localized assets directory . The partials_dir specified in options . The inherited behavior .
def partial_impl(resource, template)
    partials_dir = app.config[:partials_dir]
    file_name = File.join(localized_asset_path(partials_dir, resource), "_#{template}")
    if ::Middleman::TemplateRenderer.resolve_template( @app, file_name)
      file_name = File.join(localized_asset_path(partials_dir, resource), template)
    else
      file_name = File.join(partials_dir, "_#{template}")
      if ::Middleman::TemplateRenderer.resolve_template( @app, file_name)
        file_name = File.join(partials_dir, template)
      else
        file_name = template
      end
    end
    file_name
  end
def partial_impl ( resource , template ) partials_dir = app . config [ :partials_dir ] file_name = File . join ( localized_asset_path ( partials_dir , resource ) , "_#{template}" ) if :: Middleman :: TemplateRenderer . resolve_template ( @app , file_name ) file_name = File . join ( localized_asset_path ( partials_dir , resource ) , template ) else file_name = File . join ( partials_dir , "_#{template}" ) if :: Middleman :: TemplateRenderer . resolve_template ( @app , file_name ) file_name = File . join ( partials_dir , template ) else file_name = template end end file_name end
Provide a complete path to our version of the `partial`
helper that checks for the existence of the requested
partial in the following locations, in order:
Provide a complete path to our version of the ` partial ` helper that checks for the existence of the requested partial in the following locations in order :
resource
<not_specific>
template
<not_specific>
<not_specific>
template The name of the partial this is being requested.
template The name of the partial this is being requested .
!visibility
None