module UsefulHelpers::Helpers::SeoHelper
Public Instance Methods
build_meta_title()
click to toggle source
# File lib/useful_helpers/helpers/seo_helper.rb, line 50 def build_meta_title html = @meta_title if @medium_title.present? html << " — #{@medium_title}" end city_abbr = I18n.t("useful_helpers.city_abbr") regional_suffix = @city.present? ? @city.formatted : I18n.t("useful_helpers.regional_suffix") unless ca('welcome', 'index') || ca('granat_cms/welcome', 'index') if html.include?(regional_suffix) html << " — #{@site_name}" elsif @city.present? html << " — #{@site_name}, #{city_abbr} #{@city.ru}" else html << " — #{@full_site_name}" end end html << " | #{I18n.t('useful_helpers.page')} #{@page_counter}" if @page_counter && @page_counter != 1 html end
canonical(url)
click to toggle source
# File lib/useful_helpers/helpers/seo_helper.rb, line 13 def canonical(url) content_for :head do raw "<link rel=\"canonical\" href=\"#{url}\" />" end end
delimiter()
click to toggle source
# File lib/useful_helpers/helpers/seo_helper.rb, line 5 def delimiter raw ' → ' end
noindex()
click to toggle source
# File lib/useful_helpers/helpers/seo_helper.rb, line 19 def noindex content_for :head do noindex_tag end end
noindex_tag()
click to toggle source
# File lib/useful_helpers/helpers/seo_helper.rb, line 25 def noindex_tag raw '<meta name="robots" content="noindex, nofollow" />' end
page_title(page_title)
click to toggle source
# File lib/useful_helpers/helpers/seo_helper.rb, line 9 def page_title(page_title) content_for(:page_title) { raw("<h1>#{page_title}</h1>") } end