Module: ContentHelper

Defined in:
app/helpers/content_helper.rb

Instance Method Summary collapse

Instance Method Details

#content_meta_tags(object) ⇒ Object


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/helpers/content_helper.rb', line 2

def (object)
  twitter_tags = {
    url: object.canonical_url,
    title: object.meta_title,
    description: object.meta_description,
    image: object.opengraph_image_url,
    card: "summary"
  }

  open_graph_tags = {
    title: object.meta_title,
    description: object.meta_description,
    url: object.canonical_url,
    type: object.meta_type,
    image: object.opengraph_image_url,
    updated_time: object.updated_at.to_i
  }

  set_meta_tags title: object.meta_title,
                description: object.meta_description,
                keywords: object.meta_keywords,
                canonical: object.canonical_url,
                og: open_graph_tags,
                twitter: twitter_tags
end