jekyll-activity-pub 0.2.9 → 0.3.0rc0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll/activity_pub/activity.rb +8 -3
- data/lib/jekyll/activity_pub/notifier.rb +27 -17
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b080ff169e0ffc7f1fd426bb430184dd6bdc31892e7e6e2e9c04743120da2d12
|
4
|
+
data.tar.gz: c204a966b5a1d13de4b16b1702abf04dd8534619eeea8c1fb306fdd22b576f42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c30c6370c280c624afede374d625d54ed28013ca8e054979ba8a28272bf0ff010d4db0280a8368597a3e04d3dbe49590e5ea60430e0d84a851cc3a164461a87
|
7
|
+
data.tar.gz: a0c722700b32111c2d4cbad2806dee25155f3dbce9981844215fbb7d4a0bbb484188b3ed400d37847873dc1d87de9f2c4858af541c985e04e9b35f1efe9a6cca
|
@@ -11,6 +11,9 @@ module Jekyll
|
|
11
11
|
class Activity < Jekyll::Page
|
12
12
|
include Helper
|
13
13
|
|
14
|
+
# HTML white space removal
|
15
|
+
WHITE_SPACE = />\s+</.freeze
|
16
|
+
|
14
17
|
# @param :doc [Jekyll::Document]
|
15
18
|
attr_reader :doc
|
16
19
|
|
@@ -37,6 +40,8 @@ module Jekyll
|
|
37
40
|
|
38
41
|
# @return [nil]
|
39
42
|
def read_yaml(*)
|
43
|
+
doc_content = doc.content.tr("\n", '').gsub(WHITE_SPACE, '><')
|
44
|
+
|
40
45
|
self.data = {
|
41
46
|
'@context' => [
|
42
47
|
'https://www.w3.org/ns/activitystreams',
|
@@ -58,14 +63,14 @@ module Jekyll
|
|
58
63
|
'cc' => [Notifier.followers_url],
|
59
64
|
'inReplyTo' => doc.data['in_reply_to'],
|
60
65
|
'sensitive' => sensitive?,
|
61
|
-
'content' =>
|
66
|
+
'content' => doc_content,
|
62
67
|
'name' => doc.data['title'],
|
63
68
|
'contentMap' => {
|
64
|
-
locale =>
|
69
|
+
locale => doc_content
|
65
70
|
},
|
66
71
|
'attachment' => attachments,
|
67
72
|
'tag' => [],
|
68
|
-
'replies' =>
|
73
|
+
'replies' => Notifier.client.absolute_url(Notifier.replies(absolute_url(url)).endpoint)
|
69
74
|
}
|
70
75
|
|
71
76
|
nil
|
@@ -6,6 +6,7 @@ require 'distributed_press/version'
|
|
6
6
|
require 'distributed_press/v1/social/client'
|
7
7
|
require 'distributed_press/v1/social/inbox'
|
8
8
|
require 'distributed_press/v1/social/outbox'
|
9
|
+
require 'distributed_press/v1/social/replies'
|
9
10
|
require_relative 'errors'
|
10
11
|
require_relative 'create'
|
11
12
|
require_relative 'update'
|
@@ -273,6 +274,32 @@ module Jekyll
|
|
273
274
|
@@relative_path ||= Pathname.new(path).relative_path_from(site.source).to_s
|
274
275
|
end
|
275
276
|
|
277
|
+
def client
|
278
|
+
@@client ||= DistributedPress::V1::Social::Client.new(
|
279
|
+
private_key_pem: private_key,
|
280
|
+
url: url,
|
281
|
+
public_key_url: public_key_url,
|
282
|
+
logger: Jekyll.logger
|
283
|
+
)
|
284
|
+
end
|
285
|
+
|
286
|
+
def inbox
|
287
|
+
@@inbox ||= DistributedPress::V1::Social::Inbox.new(client: client, actor: actor)
|
288
|
+
end
|
289
|
+
|
290
|
+
def outbox
|
291
|
+
@@outbox ||= DistributedPress::V1::Social::Outbox.new(client: client, actor: actor)
|
292
|
+
end
|
293
|
+
|
294
|
+
# Generates a Replies client per activity
|
295
|
+
#
|
296
|
+
# @param activity [String] Activity ID
|
297
|
+
# @return [DistributedPress::V1::Social::Replies]
|
298
|
+
def replies(activity)
|
299
|
+
@@replies ||= {}
|
300
|
+
@@replies[activity] ||= DistributedPress::V1::Social::Replies.new(client: client, actor: actor, activity: activity)
|
301
|
+
end
|
302
|
+
|
276
303
|
private
|
277
304
|
|
278
305
|
# Finds the private key path on config
|
@@ -298,23 +325,6 @@ module Jekyll
|
|
298
325
|
@@config ||= site.config['activity_pub'] || {}
|
299
326
|
end
|
300
327
|
|
301
|
-
def client
|
302
|
-
@@client ||= DistributedPress::V1::Social::Client.new(
|
303
|
-
private_key_pem: private_key,
|
304
|
-
url: url,
|
305
|
-
public_key_url: public_key_url,
|
306
|
-
logger: Jekyll.logger
|
307
|
-
)
|
308
|
-
end
|
309
|
-
|
310
|
-
def inbox
|
311
|
-
@@inbox ||= DistributedPress::V1::Social::Inbox.new(client: client, actor: actor)
|
312
|
-
end
|
313
|
-
|
314
|
-
def outbox
|
315
|
-
@@outbox ||= DistributedPress::V1::Social::Outbox.new(client: client, actor: actor)
|
316
|
-
end
|
317
|
-
|
318
328
|
# Run action
|
319
329
|
#
|
320
330
|
# @param :path [String]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-activity-pub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0rc0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sutty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: distributed-press-api-client
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.5.0rc1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.5.0rc1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: jekyll
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -205,9 +205,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
205
205
|
version: '2.7'
|
206
206
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
207
207
|
requirements:
|
208
|
-
- - "
|
208
|
+
- - ">"
|
209
209
|
- !ruby/object:Gem::Version
|
210
|
-
version:
|
210
|
+
version: 1.3.1
|
211
211
|
requirements: []
|
212
212
|
rubygems_version: 3.3.26
|
213
213
|
signing_key:
|