jekyll-activity-pub 0.3.0rc4 → 0.3.0rc5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb938546e87448c714988213943b785dc80e45f8732f1467a5194d9062676155
4
- data.tar.gz: b3bcd5a07570d8d631c80fd1572e129f7b74d907016be00f81befb48be04beab
3
+ metadata.gz: d82abfcc625ec48dc8647caa1284c7919f38dd8c4df24268370aa993038d84ff
4
+ data.tar.gz: 784c93b7f2e39a906e205283348011c4f68f76df61cc11b89c993e91db14e70a
5
5
  SHA512:
6
- metadata.gz: 3a6ab712cf1a359bcb43a2f122b8b773899adcf63a937e4493d1e8f71d2dae11da8f0bce678f50effde0a75a363de49adc530c643605335094818fa39de04627
7
- data.tar.gz: 1d53716211728821b983f3bcc0fb6eb2a2722a310aba0cbb52aeb76225729977ab4e22cbc5558b8e3e8b4185d4bba49a1466a4b35b8d4d8fcdf3cf70e02fc413
6
+ metadata.gz: bb0a379148fbf8d2ba1362500401704de600f8188096ffbcab3dde1f2f3ea90dcef8a9461fa9de1a4d06aa041d984c871ee9f048833bbb4cec5ef403fe31aecd
7
+ data.tar.gz: df7641018f1972a00ed5c2b9105f17cb22ec95bca9d2cb804352c58c0b7d5b97144a0cbcce895345af4f7ee5e5b271b997d6aba05e4a95b3728ed7d30d28904c
@@ -42,6 +42,8 @@ module Jekyll
42
42
  def read_yaml(*)
43
43
  doc_content = doc.content.tr("\n", '').gsub(WHITE_SPACE, '><')
44
44
 
45
+ id = absolute_url(url)
46
+
45
47
  self.data = {
46
48
  '@context' => [
47
49
  'https://www.w3.org/ns/activitystreams',
@@ -51,7 +53,7 @@ module Jekyll
51
53
  }
52
54
  ],
53
55
  'type' => 'Note',
54
- 'id' => absolute_url(url),
56
+ 'id' => id,
55
57
  'url' => absolute_url(doc.url),
56
58
  'summary' => summary,
57
59
  'published' => (doc.data['created_at'] || doc.date).xmlschema,
@@ -70,7 +72,9 @@ module Jekyll
70
72
  },
71
73
  'attachment' => attachments,
72
74
  'tag' => [],
73
- 'replies' => Notifier.client.absolute_url(Notifier.replies(absolute_url(url)).endpoint)
75
+ 'replies' => Notifier.client.absolute_url(Notifier.replies(id).endpoint),
76
+ 'shares' => Notifier.client.absolute_url(Notifier.shares(id).endpoint),
77
+ 'likes' => Notifier.client.absolute_url(Notifier.likes(id).endpoint)
74
78
  }
75
79
 
76
80
  nil
@@ -7,6 +7,8 @@ require 'distributed_press/v1/social/client'
7
7
  require 'distributed_press/v1/social/inbox'
8
8
  require 'distributed_press/v1/social/outbox'
9
9
  require 'distributed_press/v1/social/replies'
10
+ require 'distributed_press/v1/social/shares'
11
+ require 'distributed_press/v1/social/likes'
10
12
  require 'distributed_press/v1/social/dereferencer'
11
13
  require_relative 'errors'
12
14
  require_relative 'create'
@@ -309,6 +311,24 @@ module Jekyll
309
311
  @@replies[activity] ||= DistributedPress::V1::Social::Replies.new(client: client, actor: actor, activity: activity)
310
312
  end
311
313
 
314
+ # Generates a Likes client per activity
315
+ #
316
+ # @param activity [String] Activity ID
317
+ # @return [DistributedPress::V1::Social::Likes]
318
+ def likes(activity)
319
+ @@likes ||= {}
320
+ @@likes[activity] ||= DistributedPress::V1::Social::Likes.new(client: client, actor: actor, activity: activity)
321
+ end
322
+
323
+ # Generates a Shares client per activity
324
+ #
325
+ # @param activity [String] Activity ID
326
+ # @return [DistributedPress::V1::Social::Shares]
327
+ def shares(activity)
328
+ @@shares ||= {}
329
+ @@shares[activity] ||= DistributedPress::V1::Social::Shares.new(client: client, actor: actor, activity: activity)
330
+ end
331
+
312
332
  private
313
333
 
314
334
  # Finds the private key path on config
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.3.0rc4
4
+ version: 0.3.0rc5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sutty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-24 00:00:00.000000000 Z
11
+ date: 2024-07-27 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.5.0rc8
19
+ version: 0.5.0rc10
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.5.0rc8
26
+ version: 0.5.0rc10
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: jekyll
29
29
  requirement: !ruby/object:Gem::Requirement