def title(custom_title_or_options = nil)
      case custom_title_or_options
      when Hash
        options = custom_title_or_options
      else
        options = {}
        custom_title = custom_title_or_options
      end

      title = custom_title
      catch(:exception) do
        title ||= t('.title', options.merge(throw: true))
      end

      provide(:page_title, title && title.html_safe) # "provide" already escapes
      content_tag(:h1, title) if title
    end
def title(custom_title_or_options = nil)
      case custom_title_or_options
      when Hash
        options = custom_title_or_options
      else
        options = {}
        custom_title = custom_title_or_options
      end

      title = custom_title
      catch(:exception) do
        title ||= t('.title', options.merge(throw: true))
      end

      provide(:page_title, title && title.html_safe) # "provide" already escapes
      content_tag(:h1, title) if title
    end
Convinient helper method that will:
 * Set custom title for the current page if it is passed. Otherwise the title will be automatically set
 * Return the title passed or looked up from locale wrapped into h1 tag