jekyll-crosspost-to-medium 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll-crosspost-to-medium.rb +12 -6
- 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: c6d2f61458ec30f8d4b319a6317f32bbb52148f3
|
4
|
+
data.tar.gz: dfbc251efda81506fded117e18c3c8c660705f22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e93af0605f0a9356b70791a45fd787b3a55605de50892b8e2a451dbfc82e7122821b73fbeaa15bd941867b69cfbc1a1218b1fe32c8b7572a888392d89da16ab
|
7
|
+
data.tar.gz: 47ab0d3dacf5eaacf7d981987308a207d5fff90e3bf11b53e2bef973ed191eb7661a2df78791e0cd712c59db9521a18f92bee356f19e171e640a5d13a641b426
|
@@ -128,23 +128,29 @@ module Jekyll
|
|
128
128
|
# Strip domain name from the URL we check against
|
129
129
|
url = url.sub(/^#{@site.config['url']}?/,'')
|
130
130
|
|
131
|
+
# coerce tage to an array
|
132
|
+
tags = post.data['tags']
|
133
|
+
if tags.kindOf?(String)
|
134
|
+
tags = tags.split(',')
|
135
|
+
end
|
136
|
+
|
131
137
|
# Only cross-post if content has not already been cross-posted
|
132
138
|
if url and ! crossposted.include? url
|
133
139
|
payload = {
|
134
140
|
'title' => title,
|
135
141
|
'contentFormat' => "html",
|
136
142
|
'content' => content,
|
137
|
-
'tags' =>
|
143
|
+
'tags' => tags,
|
138
144
|
'publishStatus' => @settings['status'] || "public",
|
139
145
|
'license' => @settings['license'] || "all-rights-reserved",
|
140
146
|
'canonicalUrl' => canonical_url
|
141
147
|
}
|
142
148
|
|
143
|
-
crosspost_to_medium(payload)
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
149
|
+
if crosspost_to_medium(payload)
|
150
|
+
crossposted << url
|
151
|
+
# Update cache
|
152
|
+
File.open(@crossposted_file, 'w') { |f| YAML.dump(crossposted, f) }
|
153
|
+
end
|
148
154
|
end
|
149
155
|
end
|
150
156
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-crosspost-to-medium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Gustafson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: " This generator cross-posts entries to Medium. To work, this script
|
14
14
|
requires\n a MEDIUM_USER_ID environment variable and a MEDIUM_INTEGRATION_TOKEN.\n\n
|