jekyll-webmention_io 2.6.2 → 2.6.3
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/generators/compile_js.rb +2 -2
- data/lib/jekyll/generators/gather_webmentions.rb +5 -5
- data/lib/jekyll/generators/queue_webmentions.rb +2 -2
- data/lib/jekyll/tags/_.rb +2 -14
- data/lib/jekyll/tags/count.rb +2 -1
- data/lib/jekyll/tags/webmentions_head.rb +4 -4
- data/lib/jekyll/tags/webmentions_js.rb +8 -16
- data/lib/jekyll/webmention_io.rb +13 -0
- data/lib/jekyll/webmention_io/version.rb +1 -1
- metadata +12 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34469c6b4a37c2117e85ee46589880aeddab27e3
|
4
|
+
data.tar.gz: 5188a0aad200b94ce371cf45abe972cd3eb4f41f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a55f6a92d741ee73c2c0b14222aafc70383f05c856f4c5755328bdc39a75ae132bb5d0a74788e4e82391401feb33ed8f35e0158ea36a775a6affc6ad48c5893
|
7
|
+
data.tar.gz: a2c23a460f6e897449d4b6bfac555a646a6d5342278d8d865d89082b3c1f35da5fc4b02873515a29aa31cba549d29bc88dd14bcac8c7266e034f931ec9ff1007
|
@@ -27,7 +27,7 @@ module Jekyll
|
|
27
27
|
priority :low
|
28
28
|
|
29
29
|
def generate(site)
|
30
|
-
if site.config
|
30
|
+
if site.config.dig( 'webmentions', 'js' ) == false
|
31
31
|
Jekyll::WebmentionIO::log 'info', 'Skipping JavaScript inclusion.'
|
32
32
|
return
|
33
33
|
end
|
@@ -36,7 +36,7 @@ module Jekyll
|
|
36
36
|
'destination' => 'js',
|
37
37
|
'uglify' => true
|
38
38
|
}
|
39
|
-
site_config = site.config
|
39
|
+
site_config = site.config.dig( 'webmentions', 'js' ) || {}
|
40
40
|
|
41
41
|
config = config.merge(site_config)
|
42
42
|
|
@@ -12,7 +12,7 @@ module Jekyll
|
|
12
12
|
priority :high
|
13
13
|
|
14
14
|
def generate(site)
|
15
|
-
if site.config
|
15
|
+
if site.config.dig( 'webmentions', 'pause_lookups' ) == true
|
16
16
|
Jekyll::WebmentionIO::log 'info', 'Webmention lookups are currently paused.'
|
17
17
|
return
|
18
18
|
end
|
@@ -49,7 +49,7 @@ module Jekyll
|
|
49
49
|
since_id = false
|
50
50
|
if @cached_webmentions.has_key? post.url
|
51
51
|
past_webmentions = @cached_webmentions[post.url]
|
52
|
-
if past_webmentions
|
52
|
+
if past_webmentions.dig( past_webmentions&.keys&.last )
|
53
53
|
since_id = past_webmentions[past_webmentions.keys.last]['raw']['id']
|
54
54
|
end
|
55
55
|
end
|
@@ -233,9 +233,9 @@ module Jekyll
|
|
233
233
|
webmention['title'] = markdownify( title ) if title
|
234
234
|
|
235
235
|
# Everything else
|
236
|
-
content = link['
|
237
|
-
if
|
238
|
-
content = link['
|
236
|
+
content = link['activity']['sentence_html']
|
237
|
+
if ['post', 'reply', 'link'].include? type
|
238
|
+
content = link['data']['content'] unless link['data']['content'].empty?
|
239
239
|
end
|
240
240
|
webmention['content'] = markdownify( content )
|
241
241
|
|
@@ -12,7 +12,7 @@ module Jekyll
|
|
12
12
|
priority :low
|
13
13
|
|
14
14
|
def generate(site)
|
15
|
-
if site.config
|
15
|
+
if site.config.dig( 'webmentions', 'pause_lookups' ) == true
|
16
16
|
Jekyll::WebmentionIO::log 'info', 'Webmention lookups are currently paused.'
|
17
17
|
return
|
18
18
|
end
|
@@ -62,7 +62,7 @@ module Jekyll
|
|
62
62
|
outgoing_webmentions.each do |source_url, webmentions|
|
63
63
|
collection = {}
|
64
64
|
webmentions.each do |target_url|
|
65
|
-
if sent_webmentions.
|
65
|
+
if sent_webmentions.dig( source_url, target_url )
|
66
66
|
collection[target_url] = ""
|
67
67
|
else
|
68
68
|
collection[target_url] = false
|
data/lib/jekyll/tags/_.rb
CHANGED
@@ -31,21 +31,9 @@ module Jekyll
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def set_template( template )
|
34
|
-
supported_templates = Jekyll::WebmentionIO::types + ['count', 'webmentions']
|
35
|
-
|
34
|
+
supported_templates = Jekyll::WebmentionIO::types + ['count', 'webmentions']
|
36
35
|
Jekyll::WebmentionIO::log 'error', "#{template} is not supported" if ! supported_templates.include? template
|
37
|
-
|
38
|
-
if Jekyll::WebmentionIO::config.has_key? 'templates' and Jekyll::WebmentionIO::config['templates'].has_key? template
|
39
|
-
# Jekyll::WebmentionIO::log 'info', "Using custom #{template} template"
|
40
|
-
template_file = Jekyll::WebmentionIO::config['templates'][template]
|
41
|
-
else
|
42
|
-
# Jekyll::WebmentionIO::log 'info', "Using default #{template} template"
|
43
|
-
template_file = File.join(File.dirname(File.expand_path(__FILE__)), "../templates/#{template}.html")
|
44
|
-
end
|
45
|
-
|
46
|
-
# Jekyll::WebmentionIO::log 'info', "Template file: #{template_file}"
|
47
|
-
handler = File.open(template_file, 'rb')
|
48
|
-
@template = handler.read
|
36
|
+
@template = Jekyll::WebmentionIO::get_template_contents( template )
|
49
37
|
# Jekyll::WebmentionIO::log 'info', "template: #{@template}"
|
50
38
|
end
|
51
39
|
|
data/lib/jekyll/tags/count.rb
CHANGED
@@ -25,4 +25,5 @@ module Jekyll
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
Liquid::Template.register_tag('webmention_count', Jekyll::WebmentionIO::WebmentionCountTag)
|
28
|
+
Liquid::Template.register_tag('webmention_count', Jekyll::WebmentionIO::WebmentionCountTag)
|
29
|
+
Liquid::Template.register_tag('webmentions_count', Jekyll::WebmentionIO::WebmentionCountTag)
|
@@ -25,10 +25,10 @@ module Jekyll
|
|
25
25
|
head << "<meta property=\"webmention:redirected_from\" content=\"#{redirect}\">"
|
26
26
|
end
|
27
27
|
|
28
|
-
|
29
|
-
if
|
30
|
-
head << "<link rel=\"pingback\" href=\"https://webmention.io/#{
|
31
|
-
head << "<link rel=\"webmention\" href=\"https://webmention.io/#{
|
28
|
+
username = site.config.dig( 'webmentions', 'username' )
|
29
|
+
if username
|
30
|
+
head << "<link rel=\"pingback\" href=\"https://webmention.io/#{username}/xmlrpc\">"
|
31
|
+
head << "<link rel=\"webmention\" href=\"https://webmention.io/#{username}/webmention\">"
|
32
32
|
end
|
33
33
|
|
34
34
|
head
|
@@ -12,15 +12,16 @@ module Jekyll
|
|
12
12
|
site = context.registers[:site]
|
13
13
|
|
14
14
|
# JS can be turned off too
|
15
|
-
if site.config
|
16
|
-
|
15
|
+
if site.config.dig( 'webmentions', 'js' ) == false
|
16
|
+
Jekyll::WebmentionIO::log 'info', 'JavaScript output is disabled, so the {% webmentions_js %} tag is being skipped'
|
17
|
+
return ''
|
17
18
|
end
|
18
19
|
|
19
20
|
config = {
|
20
|
-
'destination' =>
|
21
|
+
'destination' => 'js',
|
21
22
|
'uglify' => true
|
22
23
|
}
|
23
|
-
site_config = site.config
|
24
|
+
site_config = site.config.dig( 'webmentions', 'js' ) || {}
|
24
25
|
config = config.merge(site_config)
|
25
26
|
|
26
27
|
# JS file
|
@@ -33,18 +34,9 @@ module Jekyll
|
|
33
34
|
templates = ''
|
34
35
|
template_files = Jekyll::WebmentionIO::types + ['count', 'webmentions']
|
35
36
|
template_files.each do |template|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
else
|
40
|
-
# Jekyll::WebmentionIO::log 'info', "Using default #{template} template"
|
41
|
-
template_file = File.join(File.dirname(File.expand_path(__FILE__)), "../templates/#{template}.html")
|
42
|
-
end
|
43
|
-
# Jekyll::WebmentionIO::log 'info', "Template file: #{template_file}"
|
44
|
-
handler = File.open(template_file, 'rb')
|
45
|
-
template_contents = handler.read
|
46
|
-
|
47
|
-
templates << "<template style=\"display:none\" id=\"webmention-#{template}\">#{template_contents}</template>"
|
37
|
+
templates << "<template style=\"display:none\" id=\"webmention-#{template}\">"
|
38
|
+
templates << Jekyll::WebmentionIO::get_template_contents( template )
|
39
|
+
templates << '</template>'
|
48
40
|
end
|
49
41
|
|
50
42
|
"#{js}\n#{templates}"
|
data/lib/jekyll/webmention_io.rb
CHANGED
@@ -123,6 +123,19 @@ module Jekyll
|
|
123
123
|
response
|
124
124
|
end
|
125
125
|
|
126
|
+
def self.get_template_contents( template )
|
127
|
+
if Jekyll::WebmentionIO::config.dig( 'templates', template )
|
128
|
+
# Jekyll::WebmentionIO::log 'info', "Using custom #{template} template"
|
129
|
+
template_file = Jekyll::WebmentionIO::config['templates'][template]
|
130
|
+
else
|
131
|
+
# Jekyll::WebmentionIO::log 'info', "Using default #{template} template"
|
132
|
+
template_file = File.join(File.dirname(File.expand_path(__FILE__)), "templates/#{template}.html")
|
133
|
+
end
|
134
|
+
# Jekyll::WebmentionIO::log 'info', "Template file: #{template_file}"
|
135
|
+
handler = File.open(template_file, 'rb')
|
136
|
+
handler.read
|
137
|
+
end
|
138
|
+
|
126
139
|
# Utilities
|
127
140
|
# def key_exists(hash, test_key)
|
128
141
|
# if hash.is_a? Hash
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-webmention_io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Gustafson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -201,12 +201,16 @@ dependencies:
|
|
201
201
|
description: |
|
202
202
|
This Gem includes a suite of tools for managing webmentions in Jekyll:
|
203
203
|
|
204
|
-
* Tags
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
204
|
+
* Tags
|
205
|
+
* Count of webmentions (filterable)
|
206
|
+
* All webmentions (filterable)
|
207
|
+
* Likes
|
208
|
+
* Links
|
209
|
+
* Posts
|
210
|
+
* Replies
|
211
|
+
* Reposts
|
212
|
+
* Contents for the `head` of your pages
|
213
|
+
* JavaScript enhancements
|
210
214
|
* Commands - Send webmentions you’ve made
|
211
215
|
* Generators - Collect webmentions from Webmention.io and gather sites you’ve mentioned
|
212
216
|
email:
|