class Para::SeoTools::MetaTags::Renderer
Constants
- LINE_SEPARATOR
Attributes
template[R]
vendors[R]
Public Class Methods
new(template, vendors: nil)
click to toggle source
# File lib/para/seo_tools/meta_tags/renderer.rb, line 11 def initialize(template, vendors: nil) @template = template @vendors = vendors end
Public Instance Methods
render()
click to toggle source
# File lib/para/seo_tools/meta_tags/renderer.rb, line 16 def render [ charset_tag, title_tag, description_tag, keywords_tag, canonical_tag, vendor_tags, hreflang_tags, index_tags ].flatten.compact.join(LINE_SEPARATOR).html_safe end
Private Instance Methods
canonical_tag()
click to toggle source
# File lib/para/seo_tools/meta_tags/renderer.rb, line 53 def canonical_tag if (canonical = meta_tags.canonical).present? tag(:link, rel: 'canonical', href: canonical) end end
charset_tag()
click to toggle source
# File lib/para/seo_tools/meta_tags/renderer.rb, line 37 def charset_tag tag(:meta, charset: meta_tags.charset) end
description_tag()
click to toggle source
# File lib/para/seo_tools/meta_tags/renderer.rb, line 41 def description_tag if (description = meta_tags.description).present? tag(:meta, name: 'description', content: description) end end
keywords_tag()
click to toggle source
# File lib/para/seo_tools/meta_tags/renderer.rb, line 47 def keywords_tag if (keywords = meta_tags.keywords).present? tag(:meta, name: 'keywords', content: keywords) end end
title_tag()
click to toggle source
# File lib/para/seo_tools/meta_tags/renderer.rb, line 31 def title_tag if (title = meta_tags.title).present? content_tag(:title, title) end end