def link(title, href = "", options = {})
if href.is_a?(Hash)
options = href
href = ""
end
if href.nil? || href.strip.length < 1
path_prefix = ''
if title.match(/^(\.\.?)?\//)
path_prefix_match = title.match(/^[^\s]*\//)
path_prefix = path_prefix_match[0] if path_prefix_match
title = title[path_prefix.length, title.length]
end
href = path_prefix + urlify(title) + ".html"
end
options[:href] = "#{current_page_relative_path(href)}#{href}"
local_page = (options[:href].match(/^(\#|.+?\:)/) == nil)
unless @staticmatic.configuration.use_extensions_for_page_links || !local_page
options[:href].chomp!(".html")
options[:href].chomp!("index") if options[:href][-5, 5] == 'index'
end
tag(:a, options) { title }
end