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 +4 -4
- data/lib/jekyll/activity_pub/notifier.rb +7 -3
- data/lib/jekyll-activity-pub.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdbd4147c7bd792349eb1b7f88b0ad59a8dc049ceb1c7bc278f3035202c662b6
|
4
|
+
data.tar.gz: c9c51cd8365a8cd09ac18d9c0f207a9c27a467f9b87227805a28bf74b5b6f1a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
|
data/lib/jekyll-activity-pub.rb
CHANGED
@@ -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
|