page_meta 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/page_meta/base.rb +4 -4
- data/lib/page_meta/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: '098f9bb6d6f41562f414f69b57cb0e5ca6c77034'
|
4
|
+
data.tar.gz: 19a6825dbf0a33b5bdb2cd26b098f80230885ebe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4ca261f7b9ce10155844b32b1d77d470f5f8cce17b71678a114ebc7bdb074d56b8e3b5b2c2f8e6dff7e2d28a4e758028d46e5d33d469d1d0f19ba7658d46ea1
|
7
|
+
data.tar.gz: c330695fe010a45597362f7b26b4b7c16cf6fb5e1f2858296b19b510c637f4f31888fe67e59349c6457f83f09eb4068737f722c9927bd1f8552221295ade3d42
|
data/README.md
CHANGED
@@ -87,7 +87,7 @@ en:
|
|
87
87
|
descriptions:
|
88
88
|
site:
|
89
89
|
home: MyApp is the best way of doing something.
|
90
|
-
|
90
|
+
|
91
91
|
keywords:
|
92
92
|
site:
|
93
93
|
home: "myapp, thing, other thing"
|
@@ -128,7 +128,7 @@ Finally, you can define meta tags for Facebook and Twitter:
|
|
128
128
|
```ruby
|
129
129
|
# Meta tags for Facebook
|
130
130
|
page_meta.tag :og, {
|
131
|
-
image: asset_url("fb.png"),
|
131
|
+
image: helpers.asset_url("fb.png"),
|
132
132
|
image_type: "image/png",
|
133
133
|
image_width: 800,
|
134
134
|
image_height: 600,
|
@@ -144,7 +144,7 @@ page_meta.tag :twitter, {
|
|
144
144
|
description: @workshop.description,
|
145
145
|
site: "@howto",
|
146
146
|
creator: "@fnando",
|
147
|
-
image: asset_url(@workshop.cover_image)
|
147
|
+
image: helpers.asset_url(@workshop.cover_image)
|
148
148
|
}
|
149
149
|
```
|
150
150
|
|
@@ -161,7 +161,7 @@ page_meta.link :first, href: article_url(articles.first)
|
|
161
161
|
The hash can be any of the link tag's attributes. The following example defines the Safari 9 Pinned Tab icon:
|
162
162
|
|
163
163
|
```ruby
|
164
|
-
page_meta.link :mask_icon, color: "#4078c0", href: asset_url("mask_icon.svg")
|
164
|
+
page_meta.link :mask_icon, color: "#4078c0", href: helpers.asset_url("mask_icon.svg")
|
165
165
|
```
|
166
166
|
|
167
167
|
### Rendering the elements
|
data/lib/page_meta/base.rb
CHANGED
@@ -18,15 +18,15 @@ module PageMeta
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def links
|
21
|
-
@links ||=
|
21
|
+
@links ||= []
|
22
22
|
end
|
23
23
|
|
24
24
|
def tag(name, value)
|
25
25
|
meta_tags[name] = value
|
26
26
|
end
|
27
27
|
|
28
|
-
def link(
|
29
|
-
links
|
28
|
+
def link(rel, options)
|
29
|
+
links << {rel: rel, options: options}
|
30
30
|
end
|
31
31
|
|
32
32
|
def title
|
@@ -60,7 +60,7 @@ module PageMeta
|
|
60
60
|
|
61
61
|
def render_links
|
62
62
|
links
|
63
|
-
.map {|
|
63
|
+
.map {|info| Link.build(info[:rel], info[:options]).render }
|
64
64
|
.join("")
|
65
65
|
.html_safe
|
66
66
|
end
|
data/lib/page_meta/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: page_meta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|