jekyll-crosspost-to-medium 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/jekyll-crosspost-to-medium.rb +8 -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: f3b1e943bdd843b23b8c8cdbe2c8ccf280c4e868
|
4
|
+
data.tar.gz: 2302f1fea944203a5a998b94a1695cdcaba87cf3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06f84a5d44987eeddc0c40b8f2c3cf27adc98fb75f964bc4f36ef9c49c258a410d54a849d3a165970084355a377d2b47fa4bb770e9e69dd50fe38d8bc971e8dd
|
7
|
+
data.tar.gz: c86e6be2b2dacc5c113ae5974fb7c948b79052f91f054595be5c49e3a10bf337cc39f1aa0ac642a6149fcef1cb079cf3d26d8f2a5c1dcb6ae218b11fb15c6954
|
@@ -90,9 +90,6 @@ module Jekyll
|
|
90
90
|
content = markdown_converter.convert(post.content)
|
91
91
|
# Render any plugins
|
92
92
|
content = (Liquid::Template.parse content).render @site.site_payload
|
93
|
-
# Update absolute URLs
|
94
|
-
content = content.gsub /href=(["'])\//, "href=\1#{@site.config['url']}/"
|
95
|
-
content = content.gsub /src=(["'])\//, "src=\1#{@site.config['url']}/"
|
96
93
|
|
97
94
|
url = "#{@site.config['url']}#{post.url}"
|
98
95
|
title = post.title
|
@@ -106,10 +103,17 @@ module Jekyll
|
|
106
103
|
|
107
104
|
|
108
105
|
def crosspost_payload(crossposted, post, content, title, url)
|
106
|
+
# Update any absolute URLs
|
107
|
+
content = content.gsub /href=(["'])\//, "href=\"\1#{@site.config['url']}/"
|
108
|
+
content = content.gsub /src=(["'])\//, "src=\"\1#{@site.config['url']}/"
|
109
|
+
|
109
110
|
# Prepend the title and add a link back to originating site
|
110
111
|
content.prepend("<h1>#{title}</h1>")
|
111
112
|
content << "<p><i>This article was originally posted <a href=\"#{url}\" rel=\"canonical\">on my own site</a>.</i></p>"
|
112
113
|
|
114
|
+
# Save canonical URL
|
115
|
+
canonical_url = url
|
116
|
+
|
113
117
|
# Strip domain name from the URL we check against
|
114
118
|
url = url.sub(/^#{@site.config['url']}?/,'')
|
115
119
|
|
@@ -122,7 +126,7 @@ module Jekyll
|
|
122
126
|
'tags' => post.data['tags'],
|
123
127
|
'publishStatus' => @settings['status'] || "public",
|
124
128
|
'license' => @settings['license'] || "all-rights-reserved",
|
125
|
-
'canonicalUrl' =>
|
129
|
+
'canonicalUrl' => canonical_url
|
126
130
|
}
|
127
131
|
|
128
132
|
crosspost_to_medium(payload)
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Gustafson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: aaron@easy-designs.net
|