jekyll-crosspost-to-medium 0.1.6 → 0.1.7
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 +6 -4
- 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: d5ad5f27b1543d457921137c6e09b86812171246
|
4
|
+
data.tar.gz: ca15aea25a07a481732568c7e2bad990fc23a091
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbc7150a88df2446090c1722b16fd409bc94fe93aeec41627c1b97634de89248ae36d7320a2d7c08d6ca0026176bce83c1773a9cc69093215e4fd21a903de899
|
7
|
+
data.tar.gz: b19049bcf0b88abc1a9268875d28073f42a8eaa05a1bf4c1f86cbf6aa76a854f2af8ad2e9f5842fb9f250f66bea162db5ed9f583dc0235cd3dc0348a8bb00049
|
@@ -10,7 +10,7 @@
|
|
10
10
|
#
|
11
11
|
# `crosspost_to_medium: true`
|
12
12
|
#
|
13
|
-
# You can control crossposting globally by setting `enabled: true` under the
|
13
|
+
# You can control crossposting globally by setting `enabled: true` under the
|
14
14
|
# `jekyll-crosspost_to_medium` variable in your Jekyll configuration file.
|
15
15
|
# Setting it to false will skip the processing loop entirely which can be
|
16
16
|
# useful for local preview builds.
|
@@ -114,13 +114,13 @@ module Jekyll
|
|
114
114
|
content.prepend("<h1>#{title}</h1>")
|
115
115
|
# Append a canonical link and text
|
116
116
|
# TODO Accept a position option, e.g., top, bottom.
|
117
|
-
#
|
117
|
+
#
|
118
118
|
# User the user's config if it exists
|
119
119
|
if @settings['text']
|
120
120
|
canonical_text = "#{@settings['text']}"
|
121
121
|
canonical_text = canonical_text.gsub /{{ url }}/, canonical_url
|
122
122
|
# Otherwise, use boilerplate
|
123
|
-
else
|
123
|
+
else
|
124
124
|
canonical_text = "<p><i>This article was originally posted <a href=\"#{url}\" rel=\"canonical\">on my own site</a>.</i></p>"
|
125
125
|
end
|
126
126
|
content << canonical_text
|
@@ -179,10 +179,12 @@ module Jekyll
|
|
179
179
|
|
180
180
|
if response.code == '201'
|
181
181
|
puts "Posted '#{payload['title']}' to Medium (#{payload['publishStatus']})"
|
182
|
+
return true
|
182
183
|
else
|
183
184
|
puts "Attempted to post '#{payload['title']}' to Medium. They responded #{response.body}"
|
185
|
+
return false
|
184
186
|
end
|
185
187
|
end
|
186
188
|
|
187
189
|
end
|
188
|
-
end
|
190
|
+
end
|
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.7
|
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-02-
|
11
|
+
date: 2016-02-11 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
|