cama_meta_tag 1.2 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/app/helpers/plugins/cama_meta_tag/main_helper.rb +30 -4
- data/app/views/plugins/cama_meta_tag/admin/_meta_tag_fields.html.erb +12 -9
- data/config/camaleon_plugin.json +7 -1
- data/config/locales/en.yml +9 -1
- data/lib/cama_meta_tag/version.rb +1 -1
- metadata +27 -30
- data/app/models/plugins/cama_meta_tag/cama_meta_tag.rb +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f820766a56fe6eb7875859a8153eb97bb17c4ddad7b222f9b39aec5f3438aded
|
4
|
+
data.tar.gz: 52bff464e68cc4d17d966921acbe458ef94cf81ff7d0493b0ccbc7952f07da17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 486ffaf74ba4192e1a772475d563f3ff890570914917b7fe215e8d33f9b9f388e9156772188e85553cda997ad5cc4265019bee1dce74ce0af563c355f86d8d31
|
7
|
+
data.tar.gz: '07925587bcecfcf0706a27c19521fdd3671636d501e3ed3bae9295ed4c58e27e0e4b8ad6d439e1affbf06771e5b37e92884c8e686980bd706b2f458368ca0672'
|
@@ -13,19 +13,29 @@ module Plugins::CamaMetaTag::MainHelper
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def cama_meta_tag_on_seo(args)
|
16
|
-
if is_page?
|
16
|
+
if is_page? || is_category? || is_post_type?
|
17
17
|
page = args[:object].present? ? args[:object] : @cama_visited_post
|
18
18
|
tmp = {
|
19
19
|
title: page.get_option('seo_title').to_s.translate,
|
20
20
|
keywords: page.get_option('keywords').to_s.translate,
|
21
21
|
descr: page.get_option('seo_description').to_s.translate,
|
22
22
|
author: page.get_option('seo_author').to_s.translate,
|
23
|
-
image: page.get_option('seo_image').to_s.translate
|
23
|
+
image: page.get_option('seo_image').to_s.translate,
|
24
|
+
canonical: page.get_option('seo_canonical').to_s.translate
|
24
25
|
}
|
25
|
-
args[:seo_data][:title] = tmp[:title] if tmp[:title].present?
|
26
26
|
args[:seo_data][:keywords] = tmp[:keywords] if tmp[:keywords].present?
|
27
|
-
args[:seo_data][:description] = tmp[:descr] if tmp[:descr].present?
|
28
27
|
args[:seo_data][:author] = tmp[:author] if tmp[:author].present?
|
28
|
+
args[:seo_data][:canonical] = tmp[:canonical] if tmp[:canonical].present?
|
29
|
+
if tmp[:title].present?
|
30
|
+
args[:seo_data][:title] = tmp[:title]
|
31
|
+
args[:seo_data][:og][:title] = tmp[:title]
|
32
|
+
args[:seo_data][:twitter][:title] = tmp[:title]
|
33
|
+
end
|
34
|
+
if tmp[:descr].present?
|
35
|
+
args[:seo_data][:description] = tmp[:descr]
|
36
|
+
args[:seo_data][:og][:description] = tmp[:descr]
|
37
|
+
args[:seo_data][:twitter][:description] = tmp[:descr]
|
38
|
+
end
|
29
39
|
if tmp[:image].present?
|
30
40
|
args[:seo_data][:image] = tmp[:image]
|
31
41
|
args[:seo_data][:twitter][:image] = tmp[:image]
|
@@ -46,6 +56,22 @@ module Plugins::CamaMetaTag::MainHelper
|
|
46
56
|
!post.respond_to?(:manage_seo?)
|
47
57
|
end
|
48
58
|
|
59
|
+
def cama_meta_tag_post_type_saved(args)
|
60
|
+
args[:post_type].set_multiple_options(params[:options].permit!.to_h)
|
61
|
+
end
|
62
|
+
|
63
|
+
def cama_meta_tag_category_saved(args)
|
64
|
+
args[:category].set_multiple_options(params[:options].permit!.to_h)
|
65
|
+
end
|
66
|
+
|
67
|
+
def cama_meta_tag_post_type_form_custom_html(args)
|
68
|
+
args[:html] << render(partial: plugin_view('admin/meta_tag_fields', 'cama_meta_tag'), locals: {post: args[:post_type]})
|
69
|
+
end
|
70
|
+
|
71
|
+
def cama_meta_tag_category_form_custom_html(args)
|
72
|
+
args[:html] << render(partial: plugin_view('admin/meta_tag_fields', 'cama_meta_tag'), locals: {post: args[:category], post_type: args[:category].post_type})
|
73
|
+
end
|
74
|
+
|
49
75
|
def cama_meta_tag_post_form_custom_html(args)
|
50
76
|
unless cama_meta_tag_post_is_for_old_version?(args[:post])
|
51
77
|
manage_seo = args[:post].manage_seo?
|
@@ -1,38 +1,41 @@
|
|
1
|
-
<% t_scope = 'plugins.cama_meta_tag.admin.meta_tag_fields' %>
|
2
1
|
<div class="panel panel-default panel-toggled">
|
3
2
|
<div class="panel-heading">
|
4
|
-
<div><b><%= t('.title_seo',
|
3
|
+
<div><b><%= t('.title_seo', default: t('.title_seo', locale: :en)) %></b></div>
|
5
4
|
<ul class="panel-controls">
|
6
5
|
<li><a class="panel-collapse" href="#"><span class="fa fa-angle-up"></span></a></li>
|
7
6
|
</ul>
|
8
7
|
</div>
|
9
8
|
<div class="panel-body">
|
10
9
|
<div class="form-group">
|
11
|
-
<%= label_tag 'options[seo_title]', t('.seo_title',
|
10
|
+
<%= label_tag 'options[seo_title]', t('.seo_title', default: t('.seo_title', locale: :en)) %>
|
12
11
|
<%= text_field_tag 'options[seo_title]', post.get_option('seo_title'), class: 'form-control translatable' %>
|
13
12
|
</div>
|
14
13
|
<div class="form-group">
|
15
|
-
<%= label_tag 'options[keywords]', t('.seo_keywords',
|
14
|
+
<%= label_tag 'options[keywords]', t('.seo_keywords', default: t('.seo_keywords', locale: :en)) %>
|
16
15
|
<%= text_field_tag 'options[keywords]', post.get_option('keywords'), class: 'form-control translatable' %>
|
17
16
|
</div>
|
18
17
|
<div class="form-group">
|
19
|
-
<%= label_tag 'options[seo_description]', t('.seo_descr',
|
18
|
+
<%= label_tag 'options[seo_description]', t('.seo_descr', default: t('.seo_descr', locale: :en)) %>
|
20
19
|
<%= text_area_tag 'options[seo_description]', post.get_option('seo_description'), class: 'form-control translatable' %>
|
21
20
|
</div>
|
22
21
|
|
23
22
|
<div class="form-group">
|
24
|
-
<%= label_tag 'options[seo_author]', t('.seo_author',
|
23
|
+
<%= label_tag 'options[seo_author]', t('.seo_author', default: t('.seo_author', locale: :en)) %>
|
25
24
|
<%= text_field_tag 'options[seo_author]', post.get_option('seo_author'), class: 'form-control' %>
|
26
25
|
</div>
|
27
26
|
<div class="form-group">
|
28
|
-
<%= label_tag 'options[seo_image]', t('.seo_image',
|
27
|
+
<%= label_tag 'options[seo_image]', t('.seo_image', default: t('.seo_image', locale: :en)) %> <br>
|
29
28
|
<%= hidden_field_tag 'options[seo_image]', post.get_option('seo_image') %>
|
30
29
|
</div>
|
30
|
+
<div class="form-group">
|
31
|
+
<%= label_tag 'options[seo_canonical]', t('.seo_canonical', default: t('.seo_canonical', locale: :en)) %> <br>
|
32
|
+
<%= text_field_tag 'options[seo_canonical]', post.get_option('seo_canonical'), class: 'form-control' %>
|
33
|
+
</div>
|
31
34
|
</div>
|
32
35
|
</div>
|
33
36
|
<script type="application/javascript">
|
34
37
|
jQuery(function(){
|
35
|
-
$("#
|
36
|
-
<% if cama_meta_tag_post_is_for_old_version?(post) %> $('#
|
38
|
+
$("#options_seo_image").input_upload({label: '', title: '<%= t('.seo_image', default: t('.seo_image', locale: :en)) %>', type: 'image'});
|
39
|
+
<% if cama_meta_tag_post_is_for_old_version?(post) %> $('#post_keywords').closest('.form-group').remove(); <% end %>
|
37
40
|
})
|
38
41
|
</script>
|
data/config/camaleon_plugin.json
CHANGED
@@ -14,8 +14,14 @@
|
|
14
14
|
],
|
15
15
|
"seo": ["cama_meta_tag_on_seo"],
|
16
16
|
"post_form_custom_html": ["cama_meta_tag_post_form_custom_html"],
|
17
|
+
"created_post_type": ["cama_meta_tag_post_type_saved"],
|
18
|
+
"updated_post_type": ["cama_meta_tag_post_type_saved"],
|
17
19
|
"created_post": ["cama_meta_tag_post_saved"],
|
18
|
-
"updated_post": ["cama_meta_tag_post_saved"]
|
20
|
+
"updated_post": ["cama_meta_tag_post_saved"],
|
21
|
+
"category_form": ["cama_meta_tag_category_form_custom_html"],
|
22
|
+
"created_category": ["cama_meta_tag_category_saved"],
|
23
|
+
"updated_category": ["cama_meta_tag_category_saved"],
|
24
|
+
"post_type_settings_form": ["cama_meta_tag_post_type_form_custom_html"]
|
19
25
|
//here you can add all your hooks (read documentation)
|
20
26
|
}
|
21
27
|
}
|
data/config/locales/en.yml
CHANGED
@@ -15,6 +15,7 @@ en:
|
|
15
15
|
seo_descr: 'Description'
|
16
16
|
seo_author: 'Author'
|
17
17
|
seo_image: 'Image (Ideal: 1200 x 1200 or larger with a square aspect ratio)'
|
18
|
+
seo_canonical: 'Canonical Link'
|
18
19
|
|
19
20
|
nl:
|
20
21
|
plugins:
|
@@ -33,6 +34,7 @@ nl:
|
|
33
34
|
seo_descr: 'Beschrijving'
|
34
35
|
seo_author: 'Auteur'
|
35
36
|
seo_image: 'Afbeelding (Ideal: 1200 x 1200 of groter met een vierkant aspect ratio)'
|
37
|
+
seo_canonical: 'Canonieke Link'
|
36
38
|
|
37
39
|
pt:
|
38
40
|
plugins:
|
@@ -51,7 +53,7 @@ pt:
|
|
51
53
|
seo_descr: 'Descrição'
|
52
54
|
seo_author: 'Autor'
|
53
55
|
seo_image: 'Imagem (Ideal: 1200 x 1200 ou maior com uma relação de aspecto quadrada)'
|
54
|
-
|
56
|
+
seo_canonical: 'Link Canônico'
|
55
57
|
|
56
58
|
|
57
59
|
pt-BR:
|
@@ -71,6 +73,7 @@ pt-BR:
|
|
71
73
|
seo_descr: 'Descrição'
|
72
74
|
seo_author: 'Autor'
|
73
75
|
seo_image: 'Imagem (Ideal: 1200 x 1200 ou maior com uma relação de aspecto quadrada)'
|
76
|
+
seo_canonical: 'Canonical Link'
|
74
77
|
|
75
78
|
|
76
79
|
|
@@ -91,6 +94,7 @@ de:
|
|
91
94
|
seo_descr: 'Beschreibung'
|
92
95
|
seo_author: 'Autor'
|
93
96
|
seo_image: 'Bild (Ideal: 1200 x 1200 oder größer mit einem quadratischen Seitenverhältnis)'
|
97
|
+
seo_canonical: 'Kanonischer Link'
|
94
98
|
|
95
99
|
|
96
100
|
it:
|
@@ -110,6 +114,7 @@ it:
|
|
110
114
|
seo_descr: 'Descrizione'
|
111
115
|
seo_author: 'Autore'
|
112
116
|
seo_image: 'Immagine (ideale: 1200 x 1200 o superiore con un rapporto di aspetto di quadratura)'
|
117
|
+
seo_canonical: 'Collegamento Canonico'
|
113
118
|
|
114
119
|
zh-CN:
|
115
120
|
plugins:
|
@@ -128,6 +133,7 @@ zh-CN:
|
|
128
133
|
seo_descr: '描述'
|
129
134
|
seo_author: '作者'
|
130
135
|
seo_image: '图片(理想:1200 x 1200或更大,正方形高宽比)'
|
136
|
+
seo_canonical: '规范链接'
|
131
137
|
|
132
138
|
ru:
|
133
139
|
plugins:
|
@@ -146,6 +152,7 @@ ru:
|
|
146
152
|
seo_descr: 'Описание'
|
147
153
|
seo_author: 'автор'
|
148
154
|
seo_image: 'Изображение (Идеально: 1200 х 1200 или больше с квадратным соотношением сторон)'
|
155
|
+
seo_canonical: 'каноническая ссылка'
|
149
156
|
|
150
157
|
es:
|
151
158
|
plugins:
|
@@ -164,3 +171,4 @@ es:
|
|
164
171
|
seo_descr: 'Descripción'
|
165
172
|
seo_author: 'Autor'
|
166
173
|
seo_image: 'Imagen (Ideal: 1200 x 1200 o mayor con una relación de aspecto cuadrada)'
|
174
|
+
seo_canonical: 'Enlace Canónico'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cama_meta_tag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Owen Peredo
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -49,7 +49,6 @@ files:
|
|
49
49
|
- Rakefile
|
50
50
|
- app/controllers/plugins/cama_meta_tag/admin_controller.rb
|
51
51
|
- app/helpers/plugins/cama_meta_tag/main_helper.rb
|
52
|
-
- app/models/plugins/cama_meta_tag/cama_meta_tag.rb
|
53
52
|
- app/views/plugins/cama_meta_tag/admin/_meta_tag_fields.html.erb
|
54
53
|
- app/views/plugins/cama_meta_tag/admin/settings.html.erb
|
55
54
|
- config/camaleon_plugin.json
|
@@ -97,11 +96,11 @@ files:
|
|
97
96
|
- test/dummy/public/favicon.ico
|
98
97
|
- test/integration/navigation_test.rb
|
99
98
|
- test/test_helper.rb
|
100
|
-
homepage:
|
99
|
+
homepage: https://github.com/owen2345/camaleon-cms-seo
|
101
100
|
licenses:
|
102
101
|
- MIT
|
103
102
|
metadata: {}
|
104
|
-
post_install_message:
|
103
|
+
post_install_message:
|
105
104
|
rdoc_options: []
|
106
105
|
require_paths:
|
107
106
|
- lib
|
@@ -116,47 +115,45 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
115
|
- !ruby/object:Gem::Version
|
117
116
|
version: '0'
|
118
117
|
requirements: []
|
119
|
-
|
120
|
-
|
121
|
-
signing_key:
|
118
|
+
rubygems_version: 3.1.2
|
119
|
+
signing_key:
|
122
120
|
specification_version: 4
|
123
121
|
summary: Permit to manage the seo attributes for each page of Camaleon CMS.
|
124
122
|
test_files:
|
125
|
-
- test/
|
123
|
+
- test/dummy/app/controllers/application_controller.rb
|
124
|
+
- test/dummy/app/views/layouts/application.html.erb
|
126
125
|
- test/dummy/app/assets/javascripts/application.js
|
127
126
|
- test/dummy/app/assets/stylesheets/application.css
|
128
|
-
- test/dummy/app/controllers/application_controller.rb
|
129
127
|
- test/dummy/app/helpers/application_helper.rb
|
130
|
-
- test/dummy/app/views/layouts/application.html.erb
|
131
|
-
- test/dummy/bin/bundle
|
132
|
-
- test/dummy/bin/rails
|
133
128
|
- test/dummy/bin/rake
|
134
129
|
- test/dummy/bin/setup
|
135
|
-
- test/dummy/
|
136
|
-
- test/dummy/
|
137
|
-
- test/dummy/config/
|
138
|
-
- test/dummy/config/
|
139
|
-
- test/dummy/config/
|
130
|
+
- test/dummy/bin/bundle
|
131
|
+
- test/dummy/bin/rails
|
132
|
+
- test/dummy/config/secrets.yml
|
133
|
+
- test/dummy/config/routes.rb
|
134
|
+
- test/dummy/config/locales/en.yml
|
140
135
|
- test/dummy/config/environments/production.rb
|
136
|
+
- test/dummy/config/environments/development.rb
|
141
137
|
- test/dummy/config/environments/test.rb
|
142
|
-
- test/dummy/config/
|
138
|
+
- test/dummy/config/environment.rb
|
139
|
+
- test/dummy/config/application.rb
|
140
|
+
- test/dummy/config/database.yml
|
141
|
+
- test/dummy/config/boot.rb
|
143
142
|
- test/dummy/config/initializers/backtrace_silencers.rb
|
144
|
-
- test/dummy/config/initializers/cookies_serializer.rb
|
145
|
-
- test/dummy/config/initializers/filter_parameter_logging.rb
|
146
|
-
- test/dummy/config/initializers/inflections.rb
|
147
143
|
- test/dummy/config/initializers/mime_types.rb
|
144
|
+
- test/dummy/config/initializers/filter_parameter_logging.rb
|
148
145
|
- test/dummy/config/initializers/session_store.rb
|
149
146
|
- test/dummy/config/initializers/wrap_parameters.rb
|
150
|
-
- test/dummy/config/
|
151
|
-
- test/dummy/config/
|
152
|
-
- test/dummy/config/
|
147
|
+
- test/dummy/config/initializers/assets.rb
|
148
|
+
- test/dummy/config/initializers/cookies_serializer.rb
|
149
|
+
- test/dummy/config/initializers/inflections.rb
|
153
150
|
- test/dummy/config.ru
|
154
|
-
- test/dummy/
|
151
|
+
- test/dummy/Rakefile
|
152
|
+
- test/dummy/public/favicon.ico
|
155
153
|
- test/dummy/public/422.html
|
156
154
|
- test/dummy/public/500.html
|
157
|
-
- test/dummy/public/
|
158
|
-
- test/dummy/Rakefile
|
155
|
+
- test/dummy/public/404.html
|
159
156
|
- test/dummy/README.rdoc
|
157
|
+
- test/cama_meta_tag_test.rb
|
160
158
|
- test/integration/navigation_test.rb
|
161
159
|
- test/test_helper.rb
|
162
|
-
has_rdoc:
|