octopress-social 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +66 -21
- data/lib/octopress-social/disqus.rb +7 -3
- data/lib/octopress-social/email.rb +89 -0
- data/lib/octopress-social/facebook.rb +25 -16
- data/lib/octopress-social/github.rb +63 -0
- data/lib/octopress-social/google-plus.rb +22 -8
- data/lib/octopress-social/twitter.rb +24 -9
- data/lib/octopress-social/version.rb +1 -1
- data/lib/octopress-social.rb +8 -2
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5157a05a1fccbd57123bf4552f7970b5b494275e
|
4
|
+
data.tar.gz: 78e06a1c549a635fd4b8a3af32d2f7d9901ed943
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e398203937ab5aea38b6255f32548f697582bbdb7a1444c368b91e60fdb5433a4d81c42c7569edd66dc86f2e5c2c3a9cd0de2bee685cf101b0179cf4c2dda7e
|
7
|
+
data.tar.gz: ac1ed24e4847b75aa507a39e7610aeac082b6a7faceb737ffddac5d05a9bf95906dfbca085bd50a846b61bf731bdd6fd8fe0a2e1bc4a14f8c6f76a42fde116de
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
### 1.4.0 (2015-03-24)
|
4
|
+
- New: Email sharing and contact tags
|
5
|
+
- New: GitHub profile link
|
6
|
+
- New: All links now have title attribute set.
|
7
|
+
|
3
8
|
### 1.3.0 (2015-03-21)
|
4
9
|
- New: Embeddable tweets with {% tweet %} tag.
|
5
10
|
- Fixed: Default tweet message (without configured username) removes 'by' credit.
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Octopress Social
|
2
2
|
|
3
|
-
Easy social integrations with Twitter, Facebook,
|
3
|
+
Easy social integrations with Twitter, Facebook, Google+, Email and GitHub on any Jekyll site.
|
4
4
|
|
5
5
|
[![Build Status](http://img.shields.io/travis/octopress/social.svg)](https://travis-ci.org/octopress/social)
|
6
6
|
[![Gem Version](http://img.shields.io/gem/v/octopress-social.svg)](https://rubygems.org/gems/octopress-social)
|
@@ -29,16 +29,15 @@ Then add the gem to your Jekyll configuration.
|
|
29
29
|
|
30
30
|
## Basics
|
31
31
|
|
32
|
-
|
33
|
-
usually just a username or user id.
|
32
|
+
All configuration for this plugin is optional. Some features, like follow buttons or comment tags require username. Other than that all configurations are only necessary if you want to modify the output of the tags.
|
34
33
|
|
35
|
-
|
36
|
-
|
34
|
+
Configurations are set in your site's `_config.yml`. If for some reason these configurations conflict with another plugin, you can set them under the `octopress_social` key.
|
35
|
+
|
36
|
+
All tags respond to context. For example, in a post loop, `{% tweet_button %}` will automatically point to the current post. Used outside of a post loop, tags will refer to the current page.
|
37
37
|
|
38
38
|
## Twitter
|
39
39
|
|
40
|
-
Configure this plugin in your site's `_config.yml`.
|
41
|
-
`username`, but these are the defaults
|
40
|
+
Configure this plugin in your site's `_config.yml`. No configurations are required, just add your username if you want to use follow buttons or be mentioned in tweets. Here are the configuration defaults.
|
42
41
|
|
43
42
|
```yaml
|
44
43
|
twitter:
|
@@ -50,7 +49,8 @@ twitter:
|
|
50
49
|
embedded_link_color: # Set link color for embedded tweets
|
51
50
|
|
52
51
|
follow_count: false # Show number of followers
|
53
|
-
profile_link_text:
|
52
|
+
profile_link_text: Follow :username
|
53
|
+
profile_link_title: Follow :username on Twitter # profile link title text
|
54
54
|
```
|
55
55
|
|
56
56
|
To include hashtags, in your tweet message add them in the YAML front matter of your post or page, like this:
|
@@ -123,8 +123,7 @@ If you include the twitter widget.js in your site, this will automatically be re
|
|
123
123
|
|
124
124
|
Configure this plugin in your site's `_config.yml`.
|
125
125
|
|
126
|
-
You don't need to configure anything to start using this plugin but if you want to
|
127
|
-
use the follow button or profile link, you'll need to add your `profile_id`.
|
126
|
+
You don't need to configure anything to start using this plugin but if you want to use the follow button or profile link, you'll need to add your `profile_id`.
|
128
127
|
|
129
128
|
To get your `profile_id`, take a section from the url to your profile page `https://www.facebook.com/[profile_id]`.
|
130
129
|
|
@@ -141,8 +140,10 @@ facebook:
|
|
141
140
|
colorscheme: light # Or dark
|
142
141
|
kid_directed_site: false # Is your site directed at kids under 13?
|
143
142
|
|
144
|
-
share_link_text: Facebook
|
145
|
-
|
143
|
+
share_link_text: Facebook # Text for plain-old link
|
144
|
+
share_link_title: Share on Facebook # Share link title text
|
145
|
+
profile_link_text: Friend on Facebook
|
146
|
+
profile_link_title: Friend on Facebook # profile link title text
|
146
147
|
|
147
148
|
comment_count: 5 # Number of facebook comments to show by default
|
148
149
|
comments_link_text: Comments
|
@@ -192,17 +193,19 @@ Embed Facebook comments widget:
|
|
192
193
|
|
193
194
|
## Google+
|
194
195
|
|
195
|
-
Configure this plugin in your site's `_config.yml`.
|
196
|
+
Configure this plugin in your site's `_config.yml`. The only required configuration is your user id. Here are the defaults.
|
196
197
|
|
197
198
|
```yaml
|
198
199
|
gplus:
|
199
|
-
id:
|
200
|
-
size:
|
201
|
-
width:
|
202
|
-
share_count:
|
203
|
-
follow_count:
|
204
|
-
share_link_text:
|
205
|
-
|
200
|
+
id: # Your Google+ userid (for follow button or profile link)
|
201
|
+
size: medium # choices: small, medium, standard, large
|
202
|
+
width: # Specify width of button
|
203
|
+
share_count: false # Show number of shares or +1s
|
204
|
+
follow_count: false # Show numer of followers
|
205
|
+
share_link_text: Google+ # Text for plain-old link
|
206
|
+
share_link_title: Share on Google+ # Share link title
|
207
|
+
profile_link_text: Follow on Google+
|
208
|
+
profile_link_title: Follow on Google+ # Profile link title
|
206
209
|
```
|
207
210
|
|
208
211
|
These configurations are based on Google's [web sharing widgets](https://developers.google.com/+/web/+1button/).
|
@@ -230,9 +233,51 @@ Follow tags:
|
|
230
233
|
{% gplus_profile_link %}
|
231
234
|
```
|
232
235
|
|
236
|
+
## Email sharing
|
237
|
+
|
238
|
+
Add convenient `mail:to` links which which helps readers
|
239
|
+
contact you, or share your articles over email.
|
240
|
+
|
241
|
+
```yaml
|
242
|
+
author: # Your name
|
243
|
+
|
244
|
+
email:
|
245
|
+
address: # Your contact email
|
246
|
+
share_subject: :title by :author
|
247
|
+
share_message: :title by :author - :url
|
248
|
+
share_link_text: Email
|
249
|
+
contact_link_text: Email :author
|
250
|
+
contact_link_title: Email :author
|
251
|
+
```
|
252
|
+
|
253
|
+
The `share_subject` and `share_message` configurations are
|
254
|
+
used to generate a subject and body for a sharing email link.
|
255
|
+
|
256
|
+
### Email Tags
|
257
|
+
|
258
|
+
```
|
259
|
+
{% email_share_link %} # Share a post or page over email
|
260
|
+
{% email_contact_link %} # Contac the site's author
|
261
|
+
```
|
262
|
+
|
263
|
+
If you want, you may customize an email subject or message on
|
264
|
+
any page or post by setting the `email_share_subject` and
|
265
|
+
`email_share_message` variables in the YAML front-matter.
|
266
|
+
|
267
|
+
## GitHub
|
268
|
+
|
269
|
+
For now, this will just generate a GitHub profile link for you. Perhaps eventually I'll do some cool stuff with the API and project listing. Configure this plugin in your site's `_config.yml`.
|
270
|
+
|
271
|
+
```yaml
|
272
|
+
github:
|
273
|
+
username: # Your GitHub username
|
274
|
+
profile_link_text: :username on GitHub
|
275
|
+
profile_link_title: :username on GitHub # profile link title text
|
276
|
+
```
|
277
|
+
|
233
278
|
## Disqus Comments
|
234
279
|
|
235
|
-
Configure this plugin in your site's `_config.yml
|
280
|
+
Configure this plugin in your site's `_config.yml`. The only required configuration is your Disqus shortname. Here are the defaults.
|
236
281
|
|
237
282
|
```yaml
|
238
283
|
disqus:
|
@@ -6,12 +6,16 @@ module Octopress
|
|
6
6
|
attr_accessor :url, :config
|
7
7
|
|
8
8
|
DEFAULTS = {
|
9
|
-
'comments_link_text'
|
9
|
+
'comments_link_text' => 'Comments',
|
10
|
+
'comments_link_title' => 'View comments',
|
10
11
|
'disabled_comments_text' => 'Comments disabled'
|
11
12
|
}
|
12
13
|
|
13
14
|
def set_config(site)
|
14
|
-
@config ||=
|
15
|
+
@config ||= begin
|
16
|
+
config = site['octopress_social'] || site
|
17
|
+
DEFAULTS.merge(config['disqus'] || {})
|
18
|
+
end
|
15
19
|
end
|
16
20
|
|
17
21
|
def set_url(site, item)
|
@@ -53,7 +57,7 @@ module Octopress
|
|
53
57
|
if item['comments'] != false
|
54
58
|
link = (item['context'] == 'page' ? '' : url)
|
55
59
|
link << '#disqus_thread'
|
56
|
-
%Q{<a class="disqus-comments-link" href="#{link}">Comments</a>}
|
60
|
+
%Q{<a class="disqus-comments-link" title="#{config['comments_link_title']}" href="#{link}">Comments</a>}
|
57
61
|
elsif !config['disabled_comments_text'].empty?
|
58
62
|
%Q{<span class="disqus-comments-disabled">#{config['disabled_comments_text']}</span>}
|
59
63
|
else
|
@@ -0,0 +1,89 @@
|
|
1
|
+
module Octopress
|
2
|
+
module Social
|
3
|
+
module Email
|
4
|
+
extend self
|
5
|
+
|
6
|
+
attr_accessor :url, :config
|
7
|
+
|
8
|
+
DEFAULTS = {
|
9
|
+
'share_subject' => ':title by :author',
|
10
|
+
'share_message' => ':title by :author - :url',
|
11
|
+
'share_link_text' => 'Email',
|
12
|
+
'contact_link_text' => 'Email :author',
|
13
|
+
'contact_link_title' => 'Email :author',
|
14
|
+
'address' => nil
|
15
|
+
}
|
16
|
+
|
17
|
+
def set_config(site)
|
18
|
+
@config ||= begin
|
19
|
+
config = site['octopress_social'] || site
|
20
|
+
DEFAULTS.merge(config['email'] || {})
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def contact_link_text(item)
|
25
|
+
config['contact_link_text'].sub(':author', author(item))
|
26
|
+
end
|
27
|
+
|
28
|
+
def contact_link_title(item)
|
29
|
+
config['contact_link_title'].sub(':author', author(item))
|
30
|
+
end
|
31
|
+
|
32
|
+
def set_url(site, item)
|
33
|
+
@url = Social.full_url(site, item)
|
34
|
+
end
|
35
|
+
|
36
|
+
def author(item={})
|
37
|
+
item['author'] || item['site']['author'] || ''
|
38
|
+
end
|
39
|
+
|
40
|
+
def subject(site, item)
|
41
|
+
name = author(item)
|
42
|
+
author_var = (name.empty? ? 'by :author' : ':author')
|
43
|
+
ERB::Util.url_encode (item['email_share_subject'] || config['share_subject'])
|
44
|
+
.sub(':title', item['title'] || '')
|
45
|
+
.sub(author_var, name)
|
46
|
+
.strip
|
47
|
+
end
|
48
|
+
|
49
|
+
def message(site, item)
|
50
|
+
name = author(item)
|
51
|
+
author_var = (name.empty? ? 'by :author' : ':author')
|
52
|
+
ERB::Util.url_encode (item['email_share_message'] || config['share_message'])
|
53
|
+
.sub(':title', item['title'] || '')
|
54
|
+
.sub(author_var, name)
|
55
|
+
.sub(':url', url)
|
56
|
+
.strip
|
57
|
+
end
|
58
|
+
|
59
|
+
def email_share_link(site, item)
|
60
|
+
%Q{<a class="email-share-link" href="mailto:?subject=#{subject(site, item)}&body=#{message(site, item)}">#{config['share_link_text']}</a>}
|
61
|
+
end
|
62
|
+
|
63
|
+
def email_contact_link(site, item)
|
64
|
+
%Q{<a
|
65
|
+
class="email-contact-link"
|
66
|
+
href="mailto:#{config['address']}"
|
67
|
+
title="#{contact_link_title(item)}">#{contact_link_text(item)}</a>}
|
68
|
+
end
|
69
|
+
|
70
|
+
class Tag < Liquid::Tag
|
71
|
+
def initialize(tag, input, tokens)
|
72
|
+
@tag = tag.strip
|
73
|
+
@input = input.strip
|
74
|
+
end
|
75
|
+
|
76
|
+
def render(context)
|
77
|
+
site = context['site']
|
78
|
+
item = Octopress::Social.item(context, @input)
|
79
|
+
item['site'] = site
|
80
|
+
|
81
|
+
Octopress::Social::Email.set_config(site)
|
82
|
+
Octopress::Social::Email.set_url(site, item)
|
83
|
+
Octopress::Social::Email.send(@tag, site, item).gsub(/(\s{2,}|\n)/, ' ').strip
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -6,23 +6,28 @@ module Octopress
|
|
6
6
|
attr_accessor :url, :config
|
7
7
|
|
8
8
|
DEFAULTS = {
|
9
|
-
'profile_id'
|
10
|
-
'app_id'
|
11
|
-
'layout'
|
12
|
-
'action'
|
13
|
-
'show_faces'
|
14
|
-
'share'
|
15
|
-
'colorscheme'
|
16
|
-
'kid_directed_site'
|
17
|
-
'comment_count'
|
18
|
-
'share_link_text'
|
19
|
-
'
|
20
|
-
'
|
9
|
+
'profile_id' => nil,
|
10
|
+
'app_id' => nil,
|
11
|
+
'layout' => 'button',
|
12
|
+
'action' => 'like',
|
13
|
+
'show_faces' => false,
|
14
|
+
'share' => false,
|
15
|
+
'colorscheme' => 'light',
|
16
|
+
'kid_directed_site' => false,
|
17
|
+
'comment_count' => 5,
|
18
|
+
'share_link_text' => 'Facebook',
|
19
|
+
'share_link_title' => 'Share on Facebook',
|
20
|
+
'profile_link_text' => 'Friend on Facebook',
|
21
|
+
'profile_link_title' => 'Friend on Facebook',
|
22
|
+
'comments_link_text' => 'Comments',
|
21
23
|
'disabled_comments_text' => 'Comments disabled'
|
22
24
|
}
|
23
25
|
|
24
26
|
def set_config(site)
|
25
|
-
@config ||=
|
27
|
+
@config ||= begin
|
28
|
+
config = site['octopress_social'] || site
|
29
|
+
DEFAULTS.merge(config['facebook'] || {})
|
30
|
+
end
|
26
31
|
end
|
27
32
|
|
28
33
|
def set_url(site, item)
|
@@ -34,12 +39,12 @@ module Octopress
|
|
34
39
|
%Q{<a class="facebook-share-link" href="https://www.facebook.com/dialog/share?
|
35
40
|
app_id=#{config['app_id']}
|
36
41
|
&href=#{url}&redirect_uri=#{url}"
|
37
|
-
|
42
|
+
title="#{config['share_link_title']}">#{config['share_link_text']}</a>
|
38
43
|
}
|
39
44
|
else
|
40
45
|
%Q{<a class="facebook-share-link"
|
41
46
|
href="https://www.facebook.com/sharer/sharer.php?u=#{url}"
|
42
|
-
|
47
|
+
title="#{config['share_link_title']}">#{config['share_link_text']}</a>}
|
43
48
|
end
|
44
49
|
end
|
45
50
|
|
@@ -57,7 +62,11 @@ module Octopress
|
|
57
62
|
end
|
58
63
|
|
59
64
|
def facebook_profile_link(*args)
|
60
|
-
%Q{<a
|
65
|
+
%Q{<a
|
66
|
+
class="facebook-profile-link"
|
67
|
+
href="https://www.facebook.com/#{config['profile_id']}"
|
68
|
+
title="#{config['profile_link_title']}"
|
69
|
+
>#{config['profile_link_text']}</a>}
|
61
70
|
end
|
62
71
|
|
63
72
|
def facebook_follow_button(*args)
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module Octopress
|
2
|
+
module Social
|
3
|
+
module GitHub
|
4
|
+
|
5
|
+
attr_accessor :config
|
6
|
+
|
7
|
+
extend self
|
8
|
+
|
9
|
+
DEFAULTS = {
|
10
|
+
'username' => nil,
|
11
|
+
'profile_link_text' => ':username on GitHub',
|
12
|
+
'profile_link_title' => ':username on GitHub',
|
13
|
+
}
|
14
|
+
|
15
|
+
def set_config(site)
|
16
|
+
@config ||= begin
|
17
|
+
config = site['octopress_social'] || site
|
18
|
+
DEFAULTS.merge(config['github'] || {})
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def username(item={})
|
23
|
+
config['username'] || ''
|
24
|
+
end
|
25
|
+
|
26
|
+
def profile_link_text
|
27
|
+
config['profile_link_text'].sub(':username', username)
|
28
|
+
end
|
29
|
+
|
30
|
+
def profile_link_title
|
31
|
+
config['profile_link_title'].sub(':username', username)
|
32
|
+
end
|
33
|
+
|
34
|
+
def github_profile_link
|
35
|
+
%Q{<a
|
36
|
+
class="github-profile-link"
|
37
|
+
href="https://github.com/#{username.sub('@', '')}"
|
38
|
+
title="#{profile_link_title}">#{profile_link_text}</a>}
|
39
|
+
end
|
40
|
+
|
41
|
+
def username(item={})
|
42
|
+
if username = item['github_username'] || config['username']
|
43
|
+
"@#{username.sub('@', '')}" # ensure @ mark, but not two.
|
44
|
+
else
|
45
|
+
''
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
class Tag < Liquid::Tag
|
50
|
+
def initialize(tag, input, tokens)
|
51
|
+
@tag = tag.strip
|
52
|
+
@input = input.strip
|
53
|
+
end
|
54
|
+
|
55
|
+
def render(context)
|
56
|
+
Octopress::Social::GitHub.set_config(context['site'])
|
57
|
+
Octopress::Social::GitHub.send(@tag).gsub(/(\s{2,}|\n)/, ' ').strip
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -3,12 +3,16 @@ module Octopress
|
|
3
3
|
module GooglePlus
|
4
4
|
extend self
|
5
5
|
|
6
|
+
attr_accessor :url, :config
|
7
|
+
|
6
8
|
DEFAULTS = {
|
7
|
-
'size'
|
8
|
-
'count_bubble'
|
9
|
-
'share_link_text'
|
10
|
-
'
|
11
|
-
'
|
9
|
+
'size' => 'medium',
|
10
|
+
'count_bubble' => false,
|
11
|
+
'share_link_text' => 'Google+',
|
12
|
+
'share_link_title' => 'Share on Google+',
|
13
|
+
'profile_link_text' => 'Follow on Google+',
|
14
|
+
'profile_link_title' => 'Follow on Google+',
|
15
|
+
'width' => ''
|
12
16
|
}
|
13
17
|
|
14
18
|
HEIGHT = {
|
@@ -18,11 +22,17 @@ module Octopress
|
|
18
22
|
}
|
19
23
|
|
20
24
|
def config(site=nil)
|
21
|
-
@config ||=
|
25
|
+
@config ||= begin
|
26
|
+
config = site['octopress_social'] || site
|
27
|
+
DEFAULTS.merge(config['gplus'] || {})
|
28
|
+
end
|
22
29
|
end
|
23
30
|
|
24
31
|
def gplus_share_link(site, item)
|
25
|
-
%Q{<a
|
32
|
+
%Q{<a
|
33
|
+
class="g-plus-share-link"
|
34
|
+
href="https://plus.google.com/share?url=#{Social.full_url(site, item)}"
|
35
|
+
title="#{config['share_link_title']}">#{config['share_link_text']}</a>}
|
26
36
|
end
|
27
37
|
|
28
38
|
def gplus_one_button(site, item)
|
@@ -38,7 +48,11 @@ module Octopress
|
|
38
48
|
end
|
39
49
|
|
40
50
|
def gplus_profile_link(*args)
|
41
|
-
%Q{<a
|
51
|
+
%Q{<a
|
52
|
+
class="g-plus-profile-link"
|
53
|
+
href="//plus.google.com/u/0/#{config['userid']}"
|
54
|
+
title="#{config['profile_link_title']}"
|
55
|
+
>#{config['profile_link_text']}</a>}
|
42
56
|
end
|
43
57
|
|
44
58
|
def count(type)
|
@@ -6,16 +6,21 @@ module Octopress
|
|
6
6
|
attr_accessor :url, :config
|
7
7
|
|
8
8
|
DEFAULTS = {
|
9
|
-
'tweet_message'
|
10
|
-
'size'
|
11
|
-
'tweet_count'
|
12
|
-
'follow_count'
|
13
|
-
'tweet_link_text'
|
14
|
-
'
|
9
|
+
'tweet_message' => ":title by :username :hashtags - :url",
|
10
|
+
'size' => 'normal',
|
11
|
+
'tweet_count' => false,
|
12
|
+
'follow_count' => false,
|
13
|
+
'tweet_link_text' => "Twitter",
|
14
|
+
'tweet_link_title' => "Share on Twitter",
|
15
|
+
'profile_link_text' => "Follow :username",
|
16
|
+
'profile_link_title' => "Follow :username on Twitter",
|
15
17
|
}
|
16
18
|
|
17
19
|
def set_config(site)
|
18
|
-
@config
|
20
|
+
@config ||= begin
|
21
|
+
config = site['octopress_social'] || site
|
22
|
+
DEFAULTS.merge(config['twitter'] || {})
|
23
|
+
end
|
19
24
|
end
|
20
25
|
|
21
26
|
def set_url(site, item)
|
@@ -23,7 +28,10 @@ module Octopress
|
|
23
28
|
end
|
24
29
|
|
25
30
|
def tweet_link(site, item)
|
26
|
-
%Q{<a
|
31
|
+
%Q{<a
|
32
|
+
class="twitter-share-link"
|
33
|
+
href="https://twitter.com/intent/tweet?&text=#{ERB::Util.url_encode(message(site, item)).strip}"
|
34
|
+
title="#{config['tweet_link_title']}">#{config['tweet_link_text']}</a>}
|
27
35
|
end
|
28
36
|
|
29
37
|
def tweet_button(site, item)
|
@@ -51,6 +59,10 @@ module Octopress
|
|
51
59
|
.join(' ')
|
52
60
|
end
|
53
61
|
|
62
|
+
def profile_link_title(item={})
|
63
|
+
config['profile_link_title'].sub(':username', username)
|
64
|
+
end
|
65
|
+
|
54
66
|
def message(site, item)
|
55
67
|
username_var = (username(item).empty? ? 'by :username' : ':username')
|
56
68
|
(item['tweet_message'] || config['tweet_message'])
|
@@ -70,7 +82,10 @@ module Octopress
|
|
70
82
|
end
|
71
83
|
|
72
84
|
def twitter_profile_link(*args)
|
73
|
-
%Q{<a
|
85
|
+
%Q{<a
|
86
|
+
class="twitter-profile-link"
|
87
|
+
href="https://twitter.com/#{username.sub('@', '')}"
|
88
|
+
title="#{profile_link_title}">#{profile_link_text}</a>}
|
74
89
|
end
|
75
90
|
|
76
91
|
def twitter_follow_button(*args)
|
data/lib/octopress-social.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require 'octopress-social/version'
|
2
|
+
require 'liquid'
|
3
|
+
require 'erb'
|
3
4
|
|
4
5
|
module Octopress
|
5
6
|
module Social
|
@@ -9,6 +10,8 @@ module Octopress
|
|
9
10
|
autoload :Facebook, 'octopress-social/facebook'
|
10
11
|
autoload :GooglePlus, 'octopress-social/google-plus'
|
11
12
|
autoload :Disqus, 'octopress-social/disqus'
|
13
|
+
autoload :Email, 'octopress-social/email'
|
14
|
+
autoload :GitHub, 'octopress-social/github'
|
12
15
|
|
13
16
|
def full_url(site, item)
|
14
17
|
unless root = site['url']
|
@@ -55,6 +58,9 @@ Liquid::Template.register_tag('facebook_comments_link', Octopress::Social::Faceb
|
|
55
58
|
Liquid::Template.register_tag('facebook_script_tag', Octopress::Social::Facebook::Tag)
|
56
59
|
Liquid::Template.register_tag('disqus_comments', Octopress::Social::Disqus::Tag)
|
57
60
|
Liquid::Template.register_tag('disqus_comments_link', Octopress::Social::Disqus::Tag)
|
61
|
+
Liquid::Template.register_tag('email_share_link', Octopress::Social::Email::Tag)
|
62
|
+
Liquid::Template.register_tag('email_contact_link', Octopress::Social::Email::Tag)
|
63
|
+
Liquid::Template.register_tag('github_profile_link', Octopress::Social::GitHub::Tag)
|
58
64
|
|
59
65
|
if defined? Octopress::Docs
|
60
66
|
Octopress::Docs.add({
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octopress-social
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -91,7 +91,9 @@ files:
|
|
91
91
|
- README.md
|
92
92
|
- lib/octopress-social.rb
|
93
93
|
- lib/octopress-social/disqus.rb
|
94
|
+
- lib/octopress-social/email.rb
|
94
95
|
- lib/octopress-social/facebook.rb
|
96
|
+
- lib/octopress-social/github.rb
|
95
97
|
- lib/octopress-social/google-plus.rb
|
96
98
|
- lib/octopress-social/twitter.rb
|
97
99
|
- lib/octopress-social/version.rb
|