Sha256: fbff86974a8c66148464052d394da3cccdd7f16b7182196ae0d60b7c81283097

Contents?: true

Size: 647 Bytes

Versions: 5

Compression:

Stored size: 647 Bytes

Contents

load_plugin 'webgen/plugins/tags/tag_processor'

module Tags

  class HtmlMetaInfo < DefaultTag

    infos( :name => 'Tag/HtmlMetaInfo',
           :author => 'Andrea Censi',
           :summary => 'Writes the content of the "description","author","keywords" as HTML META tags.')

    register_tag 'htmlmetainfo'

    def process_tag( tag, chain )
      cur_node = chain.last
      s = ""
      ['description', 'author', 'keywords'].each do |key|
         if value = cur_node.meta_info[key]
            value = CGI::escapeHTML(value)
            s += "<meta name='#{key}' content='#{value}'/>\n"
         end
      end
      s
    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
webgen-0.4.4 lib/webgen/plugins/tags/htmlmetainfo.rb
webgen-0.4.3 lib/webgen/plugins/tags/htmlmetainfo.rb
webgen-0.4.5 lib/webgen/plugins/tags/htmlmetainfo.rb
webgen-0.4.6 lib/webgen/plugins/tags/htmlmetainfo.rb
webgen-0.4.7 lib/webgen/plugins/tags/htmlmetainfo.rb