jekyll-activity-pub 0.1.0rc5 → 0.1.0rc7

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: 01b5fc1068daaef69d177bdba6d3120bcd9bb43536fe1a9533047d23d8b9317e
4
- data.tar.gz: 74281543a1b7e6c69fc286ec7549f5a5cbd82c0930eb26d0498bd92c7b7c149e
3
+ metadata.gz: cdbd4147c7bd792349eb1b7f88b0ad59a8dc049ceb1c7bc278f3035202c662b6
4
+ data.tar.gz: c9c51cd8365a8cd09ac18d9c0f207a9c27a467f9b87227805a28bf74b5b6f1a0
5
5
  SHA512:
6
- metadata.gz: 985da32ad3efb30ee9b7e597abde3d6fcfb3d674a4f9c517080c3cc9646e2a9fff78a76235b865fc16d7bcdd6970390a36bc60acbb021eff2825dc595bb3b413
7
- data.tar.gz: df8bf14d76df6b1d6d2ecbae57bdb165b0e0eba0750155db538fb0ed7e578d62c073b4c696cfb709c57c56e9762738142989e6ae1c009ff0e8baa4e09559edee
6
+ metadata.gz: f73243815b8e87d2abe69d1c6d8dab4eff4f3635ced4c4a04edbf8364f6b6b34f7590535343576ab251aefbd5c206be276c6b90a6f56b9e6fed2240aa06fb5da
7
+ data.tar.gz: 74b050cd6bb725526a6e6d89042f3f6f3cef209a4a75d1e3276930c3db41052b5e2e96d06e5a2b85b2024577b9d6461e978deac3bc5ba783d2361cb128b19ff6
@@ -16,8 +16,12 @@ module Jekyll
16
16
  # Needs to be a singleton so we can use the same data across all of
17
17
  # Jekyll's build process.
18
18
  class Notifier
19
- # An struct that responds to a #url method
20
- PseudoObject = Struct.new(:url, :data, keyword_init: true)
19
+ # An struct that behaves like a page
20
+ PseudoObject = Struct.new(:url, :data, :site, :relative_path, keyword_init: true) do
21
+ def destination(_)
22
+ site.in_dest_dir(relative_path)
23
+ end
24
+ end
21
25
 
22
26
  class << self
23
27
  # Set the site and initialize data
@@ -118,7 +122,7 @@ module Jekyll
118
122
  end.each do |object_url, status|
119
123
  path = site.in_dest_dir(object_url)
120
124
  data = JSON.parse(File.read(path)) if File.exist? path
121
- object = PseudoObject.new(url: object_url, data: data || {})
125
+ object = PseudoObject.new(url: object_url, site: site, relative_path: object_url, data: data || {})
122
126
  process_object(outbox_endpoint, actor_object, object, status)
123
127
  end
124
128
 
@@ -44,7 +44,7 @@ end
44
44
  # Generate an activity for each document after the content has been
45
45
  # rendered as HTML.
46
46
  Jekyll::Hooks.register(:documents, :post_convert, priority: :high) do |doc|
47
- next if site.config['activity_pub_disable']
47
+ next if doc.site.config['activity_pub_disable']
48
48
  next unless doc.write?
49
49
  next if doc.data['sitemap'] == false
50
50
  next if doc.data['activity'] == false
@@ -99,7 +99,7 @@ end
99
99
 
100
100
  # Store data generated between builds and commits if
101
101
  # jekyll-write-and-commit-changes is enabled.
102
- Jekyll::Hooks.register(:site, :post_write, priority: :low) do |_|
102
+ Jekyll::Hooks.register(:site, :post_write, priority: :low) do |site|
103
103
  next if site.config['activity_pub_disable']
104
104
 
105
105
  Jekyll::ActivityPub::Notifier.save
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-activity-pub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0rc5
4
+ version: 0.1.0rc7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sutty