jekyll-activity-pub 0.2.8 → 0.2.10

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: 9e92fa1608034c3d855dd01580a79954838ca27da70c1ddb98547c62c72e5d23
4
- data.tar.gz: aa325a0c5b8641a90e28f8ba1e24a1dc36fd6376abc83f965b1c59adf00cf08c
3
+ metadata.gz: b7c8c48c9feaf8a6694f65b9ed392a1934ccb492105b701681ee1048c73dbfce
4
+ data.tar.gz: 7a3520277e1c376e3bf03c0f8c1bb7639185b1a0d61e8ec0759aba9f775b8628
5
5
  SHA512:
6
- metadata.gz: 51ee1ac0dffeb2d888e6afdfcf0c9c56a349d3979d27b72b26d2100d2caf17d19b62c6c66ba0755f9d4320b96e871e005b5a88bb8f5e144ad2a8463bb75d8750
7
- data.tar.gz: 90ef0f79e2c16753dceccd223749dbfb8f510da66df45f4b89fde700c353eb8298795d8b3358cb8114f634a9f39a4cdbac34b6a37ee9008c98f9540f650779b4
6
+ metadata.gz: b8a2b458cf7785d417a7140086dd946242c945ab19fd484d01b843c4c01e860e64562246f46255842838728021b899b138db1a2bcb0d7d4897ae11ce03fcaee5
7
+ data.tar.gz: 0cd9c974e382de6afc6e38d507a199ce41d5f7d356ea61a3304339cf9732cac7c771a9924332c6d8ccdacc5d2f803a7d4085d1809ebfc78c6716b77454afef35
@@ -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,10 +63,10 @@ module Jekyll
58
63
  'cc' => [Notifier.followers_url],
59
64
  'inReplyTo' => doc.data['in_reply_to'],
60
65
  'sensitive' => sensitive?,
61
- 'content' => doc.content,
66
+ 'content' => doc_content,
62
67
  'name' => doc.data['title'],
63
68
  'contentMap' => {
64
- locale => doc.content
69
+ locale => doc_content
65
70
  },
66
71
  'attachment' => attachments,
67
72
  'tag' => [],
@@ -11,7 +11,7 @@
11
11
  # activity generation but before write.
12
12
  require_relative 'jekyll-activity-pub-fep-fffd'
13
13
 
14
- Jekyll::Hooks.register %i[actor activity], :post_init, priority: 8 do |page|
14
+ Jekyll::Hooks.register %i[actor activity outbox following create update delete], :pre_render, priority: 8 do |page|
15
15
  Jekyll.logger.info 'FEP 1042:', 'Generating'
16
16
 
17
17
  site = page.site
@@ -72,8 +72,10 @@ Jekyll::Hooks.register %i[actor activity], :post_init, priority: 8 do |page|
72
72
  uri = Addressable::URI.parse(page.data['id'])
73
73
  add_protocol_to_uri(uri, protocol)
74
74
 
75
- formats.each do |format|
76
- url << Jekyll::ActivityPub::Link.new(site, uri.to_s, 'alternate', format)
75
+ if url
76
+ formats.each do |format|
77
+ url << Jekyll::ActivityPub::Link.new(site, uri.to_s, 'alternate', format)
78
+ end
77
79
  end
78
80
  end
79
81
 
@@ -84,7 +86,7 @@ Jekyll::Hooks.register %i[actor activity], :post_init, priority: 8 do |page|
84
86
  Jekyll.logger.debug 'FEP 1042:', "Generating #{uri.path} (#{protocol})"
85
87
 
86
88
  json = convert_uris(data, site.config['url'], protocol)
87
- json['url'] = url
89
+ json['url'] = url if url
88
90
  json['id'] = uri.to_s
89
91
 
90
92
  # XXX: Only works on forward slash OSes
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.2.8
4
+ version: 0.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sutty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-16 00:00:00.000000000 Z
11
+ date: 2024-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: distributed-press-api-client