Sha256: 91f561db8a0d7b93972ae1f69b0c9fd4073ae4bbce0f7ac13c04053617170b70

Contents?: true

Size: 549 Bytes

Versions: 3

Compression:

Stored size: 549 Bytes

Contents

module TopHat
  module RobotsHelper

    DEFAULT_DESCRIPTOR = 'robots'

    def noindex(descriptor=DEFAULT_DESCRIPTOR)
      descriptor ||= DEFAULT_DESCRIPTOR
      tag(:meta, :name => descriptor, :content => 'noindex')
    end

    def nofollow(descriptor=DEFAULT_DESCRIPTOR)
      descriptor ||= DEFAULT_DESCRIPTOR
      tag(:meta, :name => descriptor, :content => 'nofollow')
    end

    def canonical(path=nil)
      tag(:link, :rel => 'canonical', :href => path) if path
    end

  end
end

ActionView::Base.send :include, TopHat::RobotsHelper

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tophat-1.6.1 lib/tophat/robots.rb
tophat-1.6.0 lib/tophat/robots.rb
tophat-1.5.0 lib/tophat/robots.rb