seo_sensei 0.0.3 → 0.0.4
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.rb +1 -0
- data/lib/seo_sensei/attributes/twitter.rb +26 -0
- data/lib/seo_sensei/controllers/helpers.rb +5 -1
- data/lib/seo_sensei/version.rb +1 -1
- 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: d3c1f469002c62639dd128bfdf533b409a29a4690d6eeaeacf04ac93c1859bde
|
4
|
+
data.tar.gz: 44237338d377b31f42267b06df3023bd838c5d3e446e8355e2a0cd4533952607
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7394e430a8c2a993f3b21c111e27c9738d56dc0f649dec35fac836121c0e86483da595e0d729d9bf84009b97d1b70dc9926d278a33ed088236478391a0037e0
|
7
|
+
data.tar.gz: 5fc48288f42702af5713e7d65e51812904fb94ab6bc65d1dde76484a165ba0683a88da24b4dd0089b69fde1891e3c8e7ac186c1edc49395a71e04a2e8d354a8b
|
data/lib/seo_sensei.rb
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SeoSensei
|
4
|
+
module Attributes
|
5
|
+
module Twitter
|
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
|
+
unless image_attributes[:image].nil?
|
16
|
+
base_attributes.merge!(
|
17
|
+
image: image_attributes[:image],
|
18
|
+
card: 'summary_large_image'
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
22
|
+
{ twitter: base_attributes }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -28,7 +28,11 @@ module SeoSensei
|
|
28
28
|
translated_seo, resource, url_for(:only_path => false)
|
29
29
|
)
|
30
30
|
|
31
|
-
|
31
|
+
twitter_attributes = ::SeoSensei::Attributes::Twitter.call(
|
32
|
+
translated_seo, resource, url_for(:only_path => false)
|
33
|
+
)
|
34
|
+
|
35
|
+
set_meta_tags(translated_seo.merge(og_attributes, twitter_attributes))
|
32
36
|
end
|
33
37
|
end
|
34
38
|
end
|
data/lib/seo_sensei/version.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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paweł Dąbrowski
|
@@ -85,6 +85,7 @@ files:
|
|
85
85
|
- lib/seo_sensei.rb
|
86
86
|
- lib/seo_sensei/attributes/image.rb
|
87
87
|
- lib/seo_sensei/attributes/og.rb
|
88
|
+
- lib/seo_sensei/attributes/twitter.rb
|
88
89
|
- lib/seo_sensei/controllers/helpers.rb
|
89
90
|
- lib/seo_sensei/lookup.rb
|
90
91
|
- lib/seo_sensei/lookups/database.rb
|