jekyll-activity-pub 0.3.2 → 0.3.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3fbfdfbefdfc0ddfb57beacd697d1d6ed3bace2b498219c3acc0b7552e0767c
4
- data.tar.gz: 5b19874a8e1690ef295b29c27e58c6977f513f71376f9bd494486e6803113d89
3
+ metadata.gz: 350d3f864b9bd5ec0e7066c8bc5e596e0f5ec2ac0ac530eac13a5c9dd91f71bf
4
+ data.tar.gz: 45e6687338c7ec187a922f47ffb7b3ee665483809cc7fecd56c5a8946c8cbf4f
5
5
  SHA512:
6
- metadata.gz: bdf78715b5de945d2457341c028f550e4592392a7e14334825fdd472baa658b9a0db59575d6a71407ac9c47e8e1ebfe212f27418d68693a43f425548e78f3855
7
- data.tar.gz: 036a7c2c6c1bd7b80344e48fd15dd03a94573f77f99c75062a93ecdfc5389b3e3429c91f651a46610548ccd1a33af8126c373b99dd653ef6cde2ab8cdafedf17
6
+ metadata.gz: 608ee0c1fe87308be10153db9afa5c0b76f9b57e41c086c96e9e673580d0cdfe2b4e2c85ff84d484f9a54e9a2cfd19525f95eab3c2e011920061bd45c8453258
7
+ data.tar.gz: 9d4033d885493bcd83d83ca46ad2e1919dbc2fc951cadee8679e68dbf9906b4c179334b7c8c10b26e9404e3b97729b84585731c09b8b56b2408f1686d94b9e9e
@@ -118,6 +118,8 @@ module Jekyll
118
118
  @attachments ||= [].tap do |array|
119
119
  case (image = doc.data['image'])
120
120
  when Hash
121
+ next unless image['path']
122
+
121
123
  array << Document.new(site, image['path'], image['description'])
122
124
  when String
123
125
  array << Document.new(site, image, summary)
@@ -137,7 +137,7 @@ module Jekyll
137
137
  raise NotificationError, "Public key at #{public_key_url} differs from local version"
138
138
  end
139
139
 
140
- actor_object = object_for(site.in_dest_dir(actor_url.sub(site.config['url'], '')))
140
+ actor_object = object_for(site.in_dest_dir(URI.parse(actor_url).path))
141
141
 
142
142
  # Create/Update inbox
143
143
  unless (response = inbox.create(actor_url, announce: announce?, manually_approves_followers: manually_approves_followers?)).ok?
@@ -407,8 +407,13 @@ module Jekyll
407
407
  begin
408
408
  rel = path_relative_to_dest(path)
409
409
  path = site.in_dest_dir(rel)
410
- data = JSON.parse(File.read(path)) if File.exist? path
411
- data ||= { 'id' => status(path)['id'] }
410
+ if File.exist? path
411
+ data = JSON.parse(File.read(path))
412
+ else
413
+ Jekyll.logger.warn 'ActivityPub:', "#{path} doesn't exist!"
414
+
415
+ data = { 'id' => status(path)['id'] }
416
+ end
412
417
 
413
418
  PseudoObject.new(url: rel, site: site, relative_path: rel, data: data)
414
419
  end
@@ -61,13 +61,13 @@ module Jekyll
61
61
 
62
62
  mutable false
63
63
 
64
- # Iterate over all items of a collection
64
+ # Iterate over all public items of a collection
65
65
  #
66
66
  # @return [Array]
67
67
  def all_items
68
68
  return nil unless @obj.respond_to?(:each)
69
69
 
70
- @all_items ||= @obj.each.to_a.uniq { |x| x.uri }
70
+ @all_items ||= @obj.each.to_a.uniq { |x| x.uri }.reject(&:private?)
71
71
  end
72
72
 
73
73
  # This means we could dereference the object, Liquid can use it to
@@ -74,7 +74,10 @@ Jekyll::Hooks.register %i[actor activity outbox following create update delete],
74
74
 
75
75
  if url
76
76
  formats.each do |format|
77
- url << Jekyll::ActivityPub::Link.new(site, uri.to_s, 'alternate', format)
77
+ url << Jekyll::ActivityPub::Link.new(site, uri.to_s, 'alternate', format).tap do |link|
78
+ # XXX: Mastodon uses mimeType (?)
79
+ link.data['mimeType'] = link.data['mediaType']
80
+ end
78
81
  end
79
82
  end
80
83
  end
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.2
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sutty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-23 00:00:00.000000000 Z
11
+ date: 2026-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: distributed-press-api-client
@@ -224,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
224
  - !ruby/object:Gem::Version
225
225
  version: '0'
226
226
  requirements: []
227
- rubygems_version: 3.3.26
227
+ rubygems_version: 3.3.27
228
228
  signing_key:
229
229
  specification_version: 4
230
230
  summary: ActivityPub support for Jekyll