class Middleman::CoreExtensions::DefaultHelpers

def link_to(*args, &block)

or a Hash which will be turned into URL parameters.
query string, which can be expressed as either a String,
There is also a :query option that can be used to append a

to config.rb to have all links default to relative.

config[:relative_links] = true

relative URLs instead of absolute URLs. You can also add
:relative option which, if set to true, will produce
you'll get that resource's nice URL. Also, there is a
reference a source path, either absolutely or relatively,
Overload the regular link_to to be sitemap-aware - if you
def link_to(*args, &block)
  url_arg_index = block_given? ? 0 : 1
  options_index = block_given? ? 1 : 2
  if block_given? && args.size > 2
    raise ArgumentError, 'Too many arguments to link_to(url, options={}, &block)'
  end
  if url = args[url_arg_index]
    options = args[options_index] || {}
    raise ArgumentError, 'Options must be a hash' unless options.is_a?(Hash)
    # Transform the url through our magic url_for method
    args[url_arg_index] = url_for(url, options)
    # Cleanup before passing to Padrino
    options.except!(:relative, :current_resource, :find_resource, :query, :anchor, :fragment)
  end
  super(*args, &block)
end