Class: Shimmer::Meta
- Inherits:
-
Object
- Object
- Shimmer::Meta
- Defined in:
- lib/shimmer/utils/meta.rb
Instance Attribute Summary collapse
-
#canonical ⇒ Object
Returns the value of attribute canonical.
-
#description ⇒ Object
Returns the value of attribute description.
-
#image ⇒ Object
Returns the value of attribute image.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
Instance Attribute Details
#canonical ⇒ Object
Returns the value of attribute canonical.
6 7 8 |
# File 'lib/shimmer/utils/meta.rb', line 6 def canonical @canonical end |
#description ⇒ Object
Returns the value of attribute description.
6 7 8 |
# File 'lib/shimmer/utils/meta.rb', line 6 def description @description end |
#image ⇒ Object
Returns the value of attribute image.
6 7 8 |
# File 'lib/shimmer/utils/meta.rb', line 6 def image @image end |
#title ⇒ Object
Returns the value of attribute title.
6 7 8 |
# File 'lib/shimmer/utils/meta.rb', line 6 def title @title end |
Instance Method Details
#tags ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/shimmer/utils/meta.rb', line 8 def = [] title = self.title.present? ? "#{self.title} | #{app_name}" : app_name .push(type: :title, value: title) .push(property: "og:title", content: title) if description.present? .push(name: :description, content: description) .push(property: "og:description", content: description) end if image.present? .push(property: "og:image", content: image) end if canonical.present? .push(type: :link, rel: :canonical, href: canonical) .push(property: "og:url", content: canonical) end .push(property: "og:type", content: :website) .push(property: "og:locale", content: I18n.locale) .push(name: "twitter:card", content: :summary_large_image) end |