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 +4 -4
- data/lib/seo_sensei/attributes/image.rb +3 -5
- data/lib/seo_sensei/attributes/og.rb +19 -0
- data/lib/seo_sensei/controllers/helpers.rb +5 -2
- data/lib/seo_sensei/version.rb +1 -1
- data/lib/seo_sensei.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a2697420b8dad137413d3e13b5d68c1ca44be28a182d8f4996c8d7286c8d277
|
4
|
+
data.tar.gz: bdca9d1bf7a161b92a89d0091fbb387e6d34f63c3feeea2b23f3d481441172c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
11
|
-
|
12
|
-
|
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
|
-
|
28
|
-
|
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
|
data/lib/seo_sensei/version.rb
CHANGED
data/lib/seo_sensei.rb
CHANGED
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.
|
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
|