Module: Shimmer::MetaHelper
- Defined in:
- lib/shimmer/helpers/meta_helper.rb
Instance Method Summary collapse
- #description(value) ⇒ Object
- #image(value) ⇒ Object
- #meta ⇒ Object
- #render_meta ⇒ Object
- #title(value) ⇒ Object
Instance Method Details
#description(value) ⇒ Object
15 16 17 |
# File 'lib/shimmer/helpers/meta_helper.rb', line 15 def description(value) .description = value end |
#image(value) ⇒ Object
19 20 21 |
# File 'lib/shimmer/helpers/meta_helper.rb', line 19 def image(value) .image = image_file_url(value, width: 1200) end |
#meta ⇒ Object
5 6 7 8 9 |
# File 'lib/shimmer/helpers/meta_helper.rb', line 5 def @meta ||= Meta.new.tap do || .canonical = url_for(only_path: false) end end |
#render_meta ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/shimmer/helpers/meta_helper.rb', line 23 def = ..map do |tag| type = tag.delete(:type) || "meta" value = tag.delete(:value) content_tag(type, value, tag) end safe_join , "\n" end |
#title(value) ⇒ Object
11 12 13 |
# File 'lib/shimmer/helpers/meta_helper.rb', line 11 def title(value) .title = value end |