scrivito_seo_page_extender 1.2.3 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/concerns/open_graph_extender.rb +0 -12
- data/app/helper/seo_page_extender_helper.rb +17 -2
- data/app/views/seo_page_extender/_meta_attribute.html.erb +6 -4
- data/app/views/seo_page_extender/_meta_attribute_open_graph.html.erb +8 -6
- data/app/views/seo_page_extender/_meta_attribute_open_graph_array.html.erb +2 -2
- data/app/views/seo_page_extender/_meta_robots.html.erb +2 -2
- data/app/views/seo_page_extender/_open_graph.html.erb +1 -1
- data/app/views/seo_page_extender/_open_graph_attribute.html.erb +3 -3
- data/lib/scrivito_seo_page_extender/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0105bcb9b2c5a5cd6b22daabc25c79d42fb0a33a
|
4
|
+
data.tar.gz: 581cde117affcdccd29d069166cdfb5f3a51a003
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3584bbcb4ed86ee94b656d30a478d9f77f95474d2325f87237e5263d90406b900d810ddb81ba7c99ec8524c955830e064eb9db6311f5610b83347818fc382df9
|
7
|
+
data.tar.gz: b804d98d32280e21becff068c4902df5e41c2541d28916867368fae140957e13b3e099287a3c3f3159d076cd693852e6a1eaa197606996a9b72a10bdc7ebf1d8
|
data/README.md
CHANGED
@@ -164,6 +164,7 @@ def self.seo_attribute_mapping(obj)
|
|
164
164
|
{
|
165
165
|
og_title: obj.my_app_title,
|
166
166
|
og_description: obj.my_app_description
|
167
|
+
og_image: Obj.where(:title, :equals, 'Logo').first
|
167
168
|
...
|
168
169
|
}
|
169
170
|
end
|
@@ -269,5 +270,4 @@ en:
|
|
269
270
|
three_words: 'Three word phrases'
|
270
271
|
two_words: 'Two word phrases'
|
271
272
|
word: 'Word'
|
272
|
-
|
273
273
|
```
|
@@ -43,17 +43,5 @@ module OpenGraphExtender
|
|
43
43
|
base.attribute :music_duration, :string
|
44
44
|
base.attribute :music_musician, :stringlist
|
45
45
|
base.attribute :music_song, :stringlist
|
46
|
-
|
47
|
-
def image_width
|
48
|
-
self.og_image.meta_data[:width]
|
49
|
-
end
|
50
|
-
|
51
|
-
def image_height
|
52
|
-
self.og_image.meta_data[:height]
|
53
|
-
end
|
54
|
-
|
55
|
-
def image_type
|
56
|
-
self.og_image.meta_data[:content_type]
|
57
|
-
end
|
58
46
|
end
|
59
47
|
end
|
@@ -19,6 +19,7 @@ module SeoPageExtenderHelper
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def seo_attribute_fallback(obj, attribute)
|
22
|
+
return unless obj.respond_to?(attribute)
|
22
23
|
if seo_attribute_fallback?(obj, attribute)
|
23
24
|
seo_attribute_mapping(obj)[attribute]
|
24
25
|
else
|
@@ -26,10 +27,24 @@ module SeoPageExtenderHelper
|
|
26
27
|
end
|
27
28
|
end
|
28
29
|
|
30
|
+
def image_width(obj)
|
31
|
+
obj.meta_data[:width]
|
32
|
+
end
|
33
|
+
|
34
|
+
def image_height(obj)
|
35
|
+
obj.meta_data[:height]
|
36
|
+
end
|
37
|
+
|
38
|
+
def image_type(obj)
|
39
|
+
obj.binary_content_type
|
40
|
+
end
|
41
|
+
|
29
42
|
private
|
30
43
|
def seo_attribute_fallback?(obj, attribute)
|
31
|
-
#
|
32
|
-
ScrivitoSeoPageExtender.configuration.attribute_mapping &&
|
44
|
+
# mapping is active && attribute is included to obj
|
45
|
+
if ScrivitoSeoPageExtender.configuration.attribute_mapping && obj.respond_to?(attribute)
|
46
|
+
!obj.send(attribute.to_sym).present? && (seo_attribute_mapping(obj)[attribute]).present?
|
47
|
+
end
|
33
48
|
end
|
34
49
|
|
35
50
|
def get_words_from_page(obj, attribute)
|
@@ -1,9 +1,11 @@
|
|
1
|
-
<%
|
1
|
+
<% fallback = seo_attribute_fallback(@obj, attribute.to_sym) %>
|
2
|
+
|
3
|
+
<% if @obj.respond_to?(attribute) && fallback.present? %>
|
2
4
|
<% if name[/image\d?$/] %>
|
3
|
-
<meta content="<%=
|
5
|
+
<meta content="<%= scrivito_url(fallback) %>" name="<%= name %>"/>
|
4
6
|
<% elsif name == 'audience' || name == 'robots' || name == 'keywords' %>
|
5
|
-
<meta content="<%= @obj
|
7
|
+
<meta content="<%= seo_attribute_fallback(@obj, attribute).join(',') %>" name="<%= name %>"/>
|
6
8
|
<% else %>
|
7
|
-
<meta content="<%=
|
9
|
+
<meta content="<%= fallback %>" name="<%= name %>"/>
|
8
10
|
<% end %>
|
9
11
|
<% end %>
|
@@ -1,10 +1,12 @@
|
|
1
|
-
<%
|
1
|
+
<% fallback = seo_attribute_fallback(@obj, attribute.to_sym) %>
|
2
|
+
|
3
|
+
<% if @obj.respond_to?(attribute) && fallback.present? %>
|
2
4
|
<% if attribute == 'og_image' %>
|
3
|
-
<meta content="<%=
|
4
|
-
<meta content="<%=
|
5
|
-
<meta content="<%=
|
6
|
-
<meta content="<%=
|
5
|
+
<meta content="<%= scrivito_url(fallback) %>" property="<%= name %>"/>
|
6
|
+
<meta content="<%= image_type(fallback) %>" property="og:image:type"/>
|
7
|
+
<meta content="<%= image_width(fallback) %>" property="og:image:width"/>
|
8
|
+
<meta content="<%= image_height(fallback) %>" property="og:image:height"/>
|
7
9
|
<% else %>
|
8
|
-
<meta content="<%=
|
10
|
+
<meta content="<%= fallback %>" property="<%= name %>"/>
|
9
11
|
<% end %>
|
10
12
|
<% end %>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<% if @obj.respond_to?(attribute) &&
|
2
|
-
<% @obj
|
1
|
+
<% if @obj.respond_to?(attribute) && seo_attribute_fallback(@obj, attribute).present? %>
|
2
|
+
<% seo_attribute_fallback(@obj, attribute).each do |obj| %>
|
3
3
|
<% if !obj.is_a? String %>
|
4
4
|
<meta content="<%= scrivito_path(obj) %>" property="<%= name %>"/>
|
5
5
|
<% if obj.is_a? Image %>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<% if(@obj.respond_to?(attribute) &&
|
2
|
-
<meta content="<%= @obj
|
1
|
+
<% if(@obj.respond_to?(attribute) && seo_attribute_fallback(@obj, attribute).present?) %>
|
2
|
+
<meta content="<%= seo_attribute_fallback(@obj, attribute).join(',') %>" name="robots" />
|
3
3
|
<% else %>
|
4
4
|
<meta content="all" name="robots" />
|
5
5
|
<% end %>
|
@@ -42,5 +42,5 @@
|
|
42
42
|
<meta content="<%= canonical_link(@obj) %>" property="og:url"/>
|
43
43
|
|
44
44
|
<% if Obj.respond_to? 'open_graph_site_name' %>
|
45
|
-
<meta content="<%= Obj.open_graph_site_name %>" property="og:
|
45
|
+
<meta content="<%= Obj.open_graph_site_name %>" property="og:site_name"/>
|
46
46
|
<% end %>
|
@@ -1,7 +1,7 @@
|
|
1
|
-
<% if @obj.respond_to?(attribute) &&
|
1
|
+
<% if @obj.respond_to?(attribute) && seo_attribute_fallback(@obj, attribute).present? %>
|
2
2
|
<% if name[/image\d?$/] %>
|
3
|
-
<meta content="<%= scrivito_path(@obj
|
3
|
+
<meta content="<%= scrivito_path(seo_attribute_fallback(@obj, attribute)) %>" name="<%= name %>"/>
|
4
4
|
<% else %>
|
5
|
-
<meta content="<%= @obj
|
5
|
+
<meta content="<%= seo_attribute_fallback(@obj, attribute).tr("\u00a0", ' ').strip %>" property="<%= name %>"/>
|
6
6
|
<% end %>
|
7
7
|
<% end %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scrivito_seo_page_extender
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scrivito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: scrivito_sdk
|