Sha256: 6a1a8aba54d04104500c1318345b3e0f7cd33f371ef31d3ef9d1acfbf1f61000

Contents?: true

Size: 1.11 KB

Versions: 6

Compression:

Stored size: 1.11 KB

Contents

module DeprecatedTags
  include Radiant::Taggable

  deprecated_tag "comment", :substitute => "hide", :deadline => '2.0'

  deprecated_tag "meta", :deadline => '2.0' do |tag|
    if tag.double?
      tag.expand
    else
      tag.render('description', tag.attr) + tag.render('keywords', tag.attr)
    end
  end

  deprecated_tag 'meta:description', :deadline => '2.0' do |tag|
    show_tag = tag.attr['tag'] != 'false' || false
    description = CGI.escapeHTML(tag.locals.page.field(:description).try(:content))
    if show_tag
      "<meta name=\"description\" content=\"#{description}\" />"
    else
      description
    end
  end

  deprecated_tag 'meta:keywords', :deadline => '2.0' do |tag|
    show_tag = tag.attr['tag'] != 'false' || false
    keywords = CGI.escapeHTML(tag.locals.page.field(:keywords).try(:content))
    if show_tag
      "<meta name=\"keywords\" content=\"#{keywords}\" />"
    else
      keywords
    end
  end

  deprecated_tag "rfc1123_date", :deadline => '2.0' do |tag|
    page = tag.locals.page
    if date = page.published_at || page.created_at
      CGI.rfc1123_date(date.to_time)
    end
  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
radiant-1.1.4 app/models/deprecated_tags.rb
radiant-1.1.3 app/models/deprecated_tags.rb
radiant-1.1.2 app/models/deprecated_tags.rb
radiant-1.1.1 app/models/deprecated_tags.rb
radiant-1.1.0 app/models/deprecated_tags.rb
radiant-1.1.0.rc1 app/models/deprecated_tags.rb