seorel 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/seorel/helper.rb +6 -1
- data/lib/seorel/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92ba89393f12235236d43cb2ff0a786b78163de7
|
4
|
+
data.tar.gz: 264ff61d1cb97041071a7d12490833756285e5a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6de15533b0cb9a5942180f3af60fe308f281f7bf04f7267d98a903ef1669b5fca129bec3a7da62b96ac6bd4b14ce39a39c8f2098a8c8d02b22019028f1a71f55
|
7
|
+
data.tar.gz: e79d041107245f3d3f016b4ab03762c29a8c8b32c31a1ef8e8b882191a8771015ac700429b0f1a5d5ee93f6347e9c3463463ac98db5042aa7e84a17d05a920ca
|
data/README.md
CHANGED
@@ -12,7 +12,7 @@ Ruby on Rails SEO Metatags plugins for ActiveRecord models
|
|
12
12
|
`Gemfile.rb`:
|
13
13
|
|
14
14
|
```ruby
|
15
|
-
gem 'seorel', '~> 0.2.
|
15
|
+
gem 'seorel', '~> 0.2.2'
|
16
16
|
|
17
17
|
# the edge version can be had using:
|
18
18
|
# gem 'seorel', github: 'dalpo/seorel'
|
@@ -63,7 +63,7 @@ Edit `app/models/post.rb`:
|
|
63
63
|
```ruby
|
64
64
|
class Post < ActiveRecord::Base
|
65
65
|
extend Seorelify
|
66
|
-
seorelify
|
66
|
+
seorelify(title: :customized_title, description: :description, image: :share_image)
|
67
67
|
|
68
68
|
def customized_title
|
69
69
|
"THE BLOG: #{self.title}"
|
data/lib/seorel/helper.rb
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
module Seorel
|
2
2
|
module Helper
|
3
|
+
def seorel_locale
|
4
|
+
locale = (I18n.locale.to_s.size == 2) ? "#{I18n.locale}_#{I18n.locale}" : I18n.locale.to_s
|
5
|
+
"#{locale[0..1].downcase}_#{locale[3..4].upcase}"
|
6
|
+
end
|
7
|
+
|
3
8
|
def render_meta_tags
|
4
9
|
[render_title, render_description, render_open_graph, render_twitter_cards].join("\n").html_safe
|
5
10
|
end
|
@@ -19,7 +24,7 @@ module Seorel
|
|
19
24
|
content_tag(:meta, nil, property: 'og:title', content: seorel_params.title),
|
20
25
|
content_tag(:meta, nil, property: 'og:description', content: seorel_params.description),
|
21
26
|
content_tag(:meta, nil, property: 'og:image', content: seorel_params.image),
|
22
|
-
content_tag(:meta, nil, property: 'og:locale', content:
|
27
|
+
content_tag(:meta, nil, property: 'og:locale', content: seorel_locale)
|
23
28
|
].join("\n").html_safe
|
24
29
|
end
|
25
30
|
|
data/lib/seorel/version.rb
CHANGED