seo_sensei 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 244529d88c0e958d8ee93e4d813e2f16e778f474423a06c6d8a417e8cb696888
4
- data.tar.gz: c9feee136550df9b3f424a47994b2c8a69eeee8e67da1efb1293a783b165b287
3
+ metadata.gz: 8a2697420b8dad137413d3e13b5d68c1ca44be28a182d8f4996c8d7286c8d277
4
+ data.tar.gz: bdca9d1bf7a161b92a89d0091fbb387e6d34f63c3feeea2b23f3d481441172c3
5
5
  SHA512:
6
- metadata.gz: a1f5dfbe1c19dcf2175a0656242865b3834e53bd96400c7e57337835267e6bd7dd2a2e1f6505b8ef176e3cfdc255b0aaa070a3721e4deffd4f0b69d282c21e23
7
- data.tar.gz: 36c07cc138486baa0bbc9295f639f40529d02d58aef7256081fa6989e1bc408e16db12e267ba86735b428f53b10dcda79ef59e97599da9a5693c6abf67c827db
6
+ metadata.gz: 2fcf29c29977f7733029d2f941e77fff6c8a6ff565bdd58bc98290f57dedcdd1287f9d74e3b28c59314b42b664e0e40c288057e27047f4a6b2b6d696c1801afe
7
+ data.tar.gz: 98662d2cbe1fd7cdc1160b091ecd5e4ad302d9bee3915bdf1db575b13b6d85f93a59b4d765f39b05a7af1b2e405e985b103840471e9a952cc8272f1be07f47ce
@@ -7,11 +7,9 @@ module SeoSensei
7
7
  return {} unless resource.respond_to?(:use_seo_image?) && resource.use_seo_image?
8
8
 
9
9
  {
10
- og: {
11
- image: resource.seo_image_url,
12
- "image:width" => resource.seo_image_dimensions[:width].to_s,
13
- "image:height" => resource.seo_image_dimensions[:height].to_s
14
- }
10
+ image: resource.seo_image_url,
11
+ "image:width" => resource.seo_image_dimensions[:width].to_s,
12
+ "image:height" => resource.seo_image_dimensions[:height].to_s
15
13
  }
16
14
  end
17
15
  end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SeoSensei
4
+ module Attributes
5
+ module Og
6
+ def self.call(seo_translation, resource, url)
7
+ image_attributes = SeoSensei::Attributes::Image.call(resource)
8
+
9
+ base_attributes = {
10
+ title: seo_translation.title,
11
+ description: seo_translation.description,
12
+ url: url
13
+ }
14
+
15
+ { og: base_attributes.merge(image_attributes) }
16
+ end
17
+ end
18
+ end
19
+ end
@@ -24,8 +24,11 @@ module SeoSensei
24
24
 
25
25
  def seo_tags_with(resource)
26
26
  if (translated_seo = ::SeoSensei::Lookup.call(controller_name: controller_name, action_name: action_name, resource: resource))
27
- image_attributes = ::SeoSensei::Attributes::Image.call(resource)
28
- set_meta_tags(translated_seo.merge(image_attributes))
27
+ og_attributes = ::SeoSensei::Attributes::Og.call(
28
+ translated_seo, resource, url_for(:only_path => false)
29
+ )
30
+
31
+ set_meta_tags(translated_seo.merge(og_attributes))
29
32
  end
30
33
  end
31
34
  end
@@ -6,7 +6,7 @@ module SeoSensei
6
6
  #
7
7
  # @return [String]
8
8
  def to_s
9
- "0.0.1"
9
+ "0.0.2"
10
10
  end
11
11
  end
12
12
  end
data/lib/seo_sensei.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'meta-tags'
4
+ require 'seo_sensei/attributes/og'
4
5
  require 'seo_sensei/attributes/image'
5
6
  require 'seo_sensei/lookup'
6
7
  require 'seo_sensei/controllers/helpers'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seo_sensei
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paweł Dąbrowski
@@ -84,6 +84,7 @@ files:
84
84
  - lib/generators/templates/seo_sensei.rb
85
85
  - lib/seo_sensei.rb
86
86
  - lib/seo_sensei/attributes/image.rb
87
+ - lib/seo_sensei/attributes/og.rb
87
88
  - lib/seo_sensei/controllers/helpers.rb
88
89
  - lib/seo_sensei/lookup.rb
89
90
  - lib/seo_sensei/lookups/database.rb