scrivito_seo_page_extender 1.1.1 → 1.2.0.rc1

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
  SHA1:
3
- metadata.gz: 06c2ca29d0692ee6c94aae3c643f59355d60da76
4
- data.tar.gz: 8b1eadefeae551eba518e109973d1cdb9a27f2ba
3
+ metadata.gz: 1828959079ec657faaa075a1b1a57f102552cfa6
4
+ data.tar.gz: 9eb5838572b1b083f4479cf481adaf0cd9c29bdc
5
5
  SHA512:
6
- metadata.gz: fb48ba3ab011e81e93340e2f3b14d5d5cabed00b223e3c8feb0869ab16b3d011bb80d03609af2f6c3e24721ddc153c7535e5ab539644497178b0ec8228d3d221
7
- data.tar.gz: b6058cfb6234256c7a94dcd3dd72c16c379b84e14da8ba897417beab9e29824e9d2114562fcdfb9db457924c7846d27dc659081728017c757ccf1e04a755920d
6
+ metadata.gz: a893b8bf70de964998b91b78154a71b280eb8d559f653b17d9abdec06f0150f7515c74e24fadb603dba3e341e7090e665126560180d4e890a1554782436ef7f3
7
+ data.tar.gz: e80a6f0741b83f9b606ac5cc2cfe8a0b2fba7380b5c3d918f14f70da29ed59a6f199e53e702816c52c5aa68cf59c36ff0da55a32c52bad97480c8732bdf9a8e1
@@ -43,5 +43,17 @@ module OpenGraphExtender
43
43
  base.attribute :music_album, :stringlist
44
44
  base.attribute :music_creator, :string
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
46
58
  end
47
59
  end
@@ -1,7 +1,7 @@
1
1
  module TwitterCardsExtender
2
2
  def self.included(base)
3
3
  # General Attributes
4
- base.attribute :tc_card, :enum, values: ["summary", "summary_large_image", "photo", "gallery", "product", "app", "player"]
4
+ base.attribute :tc_card, :enum, values: ["summary", "summary_large_image", "app", "player"]
5
5
  base.attribute :tc_creator, :string
6
6
  base.attribute :tc_site, :string
7
7
  base.attribute :tc_title, :string
@@ -9,12 +9,7 @@ module TwitterCardsExtender
9
9
 
10
10
  # Image and Gallery
11
11
  base.attribute :tc_image, :reference
12
- base.attribute :tc_image_width, :string
13
- base.attribute :tc_image_height, :string
14
- base.attribute :tc_image1, :reference
15
- base.attribute :tc_image2, :reference
16
- base.attribute :tc_image3, :reference
17
- base.attribute :tc_image4, :reference
12
+ base.attribute :tc_image_alt, :reference
18
13
 
19
14
  # For type app
20
15
  base.attribute :tc_app_name_iphone, :string
@@ -34,11 +29,5 @@ module TwitterCardsExtender
34
29
  base.attribute :tc_player_height, :string
35
30
  base.attribute :tc_player_stream, :string
36
31
  base.attribute :tc_player_stream_content_type, :string
37
-
38
- # For type Product
39
- base.attribute :tc_product_data1, :string
40
- base.attribute :tc_product_label1, :string
41
- base.attribute :tc_product_data2, :string
42
- base.attribute :tc_product_label2, :string
43
32
  end
44
33
  end
@@ -1,10 +1,9 @@
1
1
  <% if @obj.respond_to?(attribute) && seo_attribute_fallback(@obj, attribute.to_sym).present? %>
2
- <% if @obj[attribute].respond_to?('binary?') && @obj[attribute].binary? %>
2
+ <% if attribute == 'og_image' %>
3
3
  <meta content="<%= scrivito_path(@obj[attribute]) %>" property="<%= name %>"/>
4
- <% if @obj.is_a? Image %>
5
- <meta content="<%= obj.width %>" property="og:image:width"/>
6
- <meta content="<%= obj.height %>" property="og:image:height"/>
7
- <% end %>
4
+ <meta content="<%= @obj.image_type %>" property="og:image:type"/>
5
+ <meta content="<%= @obj.image_width %>" property="og:image:width"/>
6
+ <meta content="<%= @obj.image_height %>" property="og:image:height"/>
8
7
  <% else %>
9
8
  <meta content="<%= seo_attribute_fallback(@obj, attribute.to_sym) %>" property="<%= name %>"/>
10
9
  <% end %>
@@ -4,12 +4,6 @@
4
4
  <%= render "seo_page_extender/meta_attribute", attribute: "tc_title", name: "twitter:title" -%>
5
5
  <%= render "seo_page_extender/meta_attribute", attribute: "tc_description", name: "twitter:description" -%>
6
6
  <%= render "seo_page_extender/meta_attribute", attribute: "tc_image", name: "twitter:image" -%>
7
- <%= render "seo_page_extender/meta_attribute", attribute: "tc_image_width", name: "twitter:imag:width" -%>
8
- <%= render "seo_page_extender/meta_attribute", attribute: "tc_image_height", name: "twitter:imag:height" -%>
9
- <%= render "seo_page_extender/meta_attribute", attribute: "tc_image0", name: "twitter:image1" -%>
10
- <%= render "seo_page_extender/meta_attribute", attribute: "tc_image1", name: "twitter:image2" -%>
11
- <%= render "seo_page_extender/meta_attribute", attribute: "tc_image2", name: "twitter:image3" -%>
12
- <%= render "seo_page_extender/meta_attribute", attribute: "tc_image3", name: "twitter:image4" -%>
13
7
  <%= render "seo_page_extender/meta_attribute", attribute: "tc_app_name_iphone", name: "twitter:app:name:iphone" -%>
14
8
  <%= render "seo_page_extender/meta_attribute", attribute: "tc_app_id_iphone", name: "twitter:app:id:iphone" -%>
15
9
  <%= render "seo_page_extender/meta_attribute", attribute: "tc_app_url_iphone", name: "twitter:url:iphone" -%>
@@ -25,7 +19,3 @@
25
19
  <%= render "seo_page_extender/meta_attribute", attribute: "tc_player_height", name: "twitter:player:height" -%>
26
20
  <%= render "seo_page_extender/meta_attribute", attribute: "tc_player_stream", name: "twitter:player:stream" -%>
27
21
  <%= render "seo_page_extender/meta_attribute", attribute: "tc_player_stream_content_type", name: "twitter:player:stream:content_type" -%>
28
- <%= render "seo_page_extender/meta_attribute", attribute: "tc_product_data1", name: "twitter:data1" -%>
29
- <%= render "seo_page_extender/meta_attribute", attribute: "tc_product_label1", name: "twitter:label1" -%>
30
- <%= render "seo_page_extender/meta_attribute", attribute: "tc_product_data2", name: "twitter:data2" -%>
31
- <%= render "seo_page_extender/meta_attribute", attribute: "tc_product_label2", name: "twitter:label2" -%>
@@ -4,10 +4,7 @@
4
4
 
5
5
  <ul class="tab-list" id="twitter-card-types-tab">
6
6
  <%= content_tag :li, 'Base attributes', data: {panel_target: '#edit-twitter-card-general'}%>
7
- <%= content_tag :li, 'Photo & Summary', data: {panel_target: '#edit-twitter-card-photo', allowed_values: ['summary_large_image', 'photo']}%>
8
- <%= content_tag :li, 'Gallery attributes', data: {panel_target: '#edit-twitter-card-gallery', allowed_values: ['gallery']}%>
9
7
  <%= content_tag :li, 'App attributes', data: {panel_target: '#edit-twitter-card-app', allowed_values: ['app']}%>
10
- <%= content_tag :li, 'Product attributes', data: {panel_target: '#edit-twitter-card-product', allowed_values: ['product']}%>
11
8
  <%= content_tag :li, 'Player attributes', data: {panel_target: '#edit-twitter-card-player', allowed_values: ['player']}%>
12
9
  </ul>
13
10
 
@@ -29,50 +26,10 @@
29
26
  <%= scrivito_details_for 'Description' do %>
30
27
  <%= scrivito_tag(:div, obj, :tc_description) %>
31
28
  <% end %>
32
- </div>
33
-
34
- <div class="tab-panel" id="edit-twitter-card-photo">
35
- <div class="row">
36
- <div class="col-xs-4">
37
- <%= scrivito_details_for 'Image' do %>
38
- <%= scrivito_tag(:div, obj, :tc_image) %>
39
- <% end %>
40
- </div>
41
- <div class="col-xs-8">
42
- <%= scrivito_details_for 'Width' do %>
43
- <%= scrivito_tag(:div, obj, :tc_image_width) %>
44
- <% end %>
45
-
46
- <%= scrivito_details_for 'height' do %>
47
- <%= scrivito_tag(:div, obj, :tc_image_height) %>
48
- <% end %>
49
- </div>
50
- </div>
51
- </div>
52
29
 
53
- <div class="tab-panel" id="edit-twitter-card-gallery">
54
- <div class="row">
55
- <div class="col-xs-3">
56
- <%= scrivito_details_for 'Image 1' do %>
57
- <%= scrivito_tag(:div, obj, :tc_image1) %>
58
- <% end %>
59
- </div>
60
- <div class="col-xs-3">
61
- <%= scrivito_details_for 'Image 2' do %>
62
- <%= scrivito_tag(:div, obj, :tc_image2) %>
63
- <% end %>
64
- </div>
65
- <div class="col-xs-3">
66
- <%= scrivito_details_for 'Image 3' do %>
67
- <%= scrivito_tag(:div, obj, :tc_image3) %>
68
- <% end %>
69
- </div>
70
- <div class="col-xs-3">
71
- <%= scrivito_details_for 'Image 4' do %>
72
- <%= scrivito_tag(:div, obj, :tc_image4) %>
73
- <% end %>
74
- </div>
75
- </div>
30
+ <%= scrivito_details_for 'Image' do %>
31
+ <%= scrivito_tag(:div, obj, :tc_image) %>
32
+ <% end %>
76
33
  </div>
77
34
 
78
35
  <div class="tab-panel" id="edit-twitter-card-app">
@@ -138,27 +95,6 @@
138
95
  </div>
139
96
  </div>
140
97
  </div>
141
-
142
- <div class="tab-panel" id="edit-twitter-card-product">
143
- <div class="row">
144
- <div class="col-xs-6">
145
- <%= scrivito_details_for 'Top Data' do %>
146
- <h4>Top customizable data field</h4>
147
- <%= scrivito_tag(:div, obj, :tc_product_data1) %>
148
- <h4>Customizable label or units</h4>
149
- <%= scrivito_tag(:div, obj, :tc_product_label1) %>
150
- <% end %>
151
- </div>
152
- <div class="col-xs-6">
153
- <%= scrivito_details_for 'Bottom Data' do %>
154
- <h4>Bottom customizable data field</h4>
155
- <%= scrivito_tag(:div, obj, :tc_product_data2) %>
156
- <h4>Customizable label or units</h4>
157
- <%= scrivito_tag(:div, obj, :tc_product_label2) %>
158
- <% end %>
159
- </div>
160
- </div>
161
- </div>
162
98
  </div>
163
99
 
164
100
  <div class="alert alert-info">
@@ -1,3 +1,3 @@
1
1
  module ScrivitoSeoPageExtender
2
- VERSION = "1.1.1"
2
+ VERSION = "1.2.0.rc1"
3
3
  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.1.1
4
+ version: 1.2.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scrivito
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-17 00:00:00.000000000 Z
11
+ date: 2017-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: scrivito_sdk
@@ -83,9 +83,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
83
83
  version: '0'
84
84
  required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ">="
86
+ - - ">"
87
87
  - !ruby/object:Gem::Version
88
- version: '0'
88
+ version: 1.3.1
89
89
  requirements: []
90
90
  rubyforge_project:
91
91
  rubygems_version: 2.5.1