jekyll-activity-pub 0.2.1 → 0.2.3
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:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 25980131086d34cbf873f6b6ae1d40ce1f75ea6955befbf1e5a565752bf06109
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: e3312417ad44dcfec2890a80a48260aff9b189b47c1ff5c8f2fa6ed8cda5a470
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 2a2596e48239c38d84622f98afffa5f2e228edebe839d8bcd47f355b7fc248b6888496e7a3949d6e9bd3869bea3c2a59686a5d8079bc1cb87f6f2353e954d54d
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 15a1ea8620e2376b32b5f347f88657b1c9133bbbef4be08c7bfc764501e0979921d871330ddba35b4445522261c9c5947d4a6f7245a8ea423e32d028166d4f9f
         
     | 
| 
         @@ -16,6 +16,15 @@ module Jekyll 
     | 
|
| 
       16 
16 
     | 
    
         
             
                  # Some filters needs a Liquid-like context
         
     | 
| 
       17 
17 
     | 
    
         
             
                  StubContext = Struct.new(:registers, keyword_init: true)
         
     | 
| 
       18 
18 
     | 
    
         | 
| 
      
 19 
     | 
    
         
            +
                  # Removes empty values from data
         
     | 
| 
      
 20 
     | 
    
         
            +
                  #
         
     | 
| 
      
 21 
     | 
    
         
            +
                  # @return [Hash]
         
     | 
| 
      
 22 
     | 
    
         
            +
                  def pruned_data
         
     | 
| 
      
 23 
     | 
    
         
            +
                    data.reject do |_, v|
         
     | 
| 
      
 24 
     | 
    
         
            +
                      v.nil? || (v.respond_to?(:empty?) && v.empty?)
         
     | 
| 
      
 25 
     | 
    
         
            +
                    end
         
     | 
| 
      
 26 
     | 
    
         
            +
                  end
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
       19 
28 
     | 
    
         
             
                  # Renders the data hash as a stringified JSON
         
     | 
| 
       20 
29 
     | 
    
         
             
                  #
         
     | 
| 
       21 
30 
     | 
    
         
             
                  # @return [String]
         
     | 
| 
         @@ -188,12 +197,6 @@ module Jekyll 
     | 
|
| 
       188 
197 
     | 
    
         | 
| 
       189 
198 
     | 
    
         
             
                    absolute_url url
         
     | 
| 
       190 
199 
     | 
    
         
             
                  end
         
     | 
| 
       191 
     | 
    
         
            -
             
     | 
| 
       192 
     | 
    
         
            -
                  def pruned_data
         
     | 
| 
       193 
     | 
    
         
            -
                    data.reject do |_, v|
         
     | 
| 
       194 
     | 
    
         
            -
                      v.nil? || (v.respond_to?(:empty?) && v.empty?)
         
     | 
| 
       195 
     | 
    
         
            -
                    end
         
     | 
| 
       196 
     | 
    
         
            -
                  end
         
     | 
| 
       197 
200 
     | 
    
         
             
                end
         
     | 
| 
       198 
201 
     | 
    
         
             
              end
         
     | 
| 
       199 
202 
     | 
    
         
             
            end
         
     | 
| 
         @@ -123,8 +123,13 @@ module Jekyll 
     | 
|
| 
       123 
123 
     | 
    
         
             
                      actor_object = object_for(site.in_dest_dir(actor_url.sub(site.config['url'], '')))
         
     | 
| 
       124 
124 
     | 
    
         | 
| 
       125 
125 
     | 
    
         
             
                      # Create inbox
         
     | 
| 
       126 
     | 
    
         
            -
                       
     | 
| 
       127 
     | 
    
         
            -
             
     | 
| 
      
 126 
     | 
    
         
            +
                      #
         
     | 
| 
      
 127 
     | 
    
         
            +
                      # @todo Updating/Key rotation seems broken for now
         
     | 
| 
      
 128 
     | 
    
         
            +
                      # @see {https://github.com/hyphacoop/social.distributed.press/issues/51}
         
     | 
| 
      
 129 
     | 
    
         
            +
                      unless inbox.get.ok?
         
     | 
| 
      
 130 
     | 
    
         
            +
                        unless (response = inbox.create(actor_url)).ok?
         
     | 
| 
      
 131 
     | 
    
         
            +
                          raise NotificationError, "Couldn't create/update inbox (#{response.code}: #{response.message})"
         
     | 
| 
      
 132 
     | 
    
         
            +
                        end
         
     | 
| 
       128 
133 
     | 
    
         
             
                      end
         
     | 
| 
       129 
134 
     | 
    
         | 
| 
       130 
135 
     | 
    
         
             
                      # Remove notifications already performed and notify
         
     | 
| 
         @@ -7,7 +7,8 @@ 
     | 
|
| 
       7 
7 
     | 
    
         
             
            # the original activities after this plugins runs, use priority 0.
         
     | 
| 
       8 
8 
     | 
    
         
             
            #
         
     | 
| 
       9 
9 
     | 
    
         
             
            # The hook runs on pre render so we can add the extra pages.
         
     | 
| 
       10 
     | 
    
         
            -
            Jekyll::Hooks.register :site, : 
     | 
| 
      
 10 
     | 
    
         
            +
            Jekyll::Hooks.register :site, :post_render, priority: 1 do |site|
         
     | 
| 
      
 11 
     | 
    
         
            +
              require 'pry'
         
     | 
| 
       11 
12 
     | 
    
         
             
              require 'jekyll/activity_pub/link'
         
     | 
| 
       12 
13 
     | 
    
         | 
| 
       13 
14 
     | 
    
         
             
              # Changes the URLs from a base URL to have a different scheme
         
     | 
| 
         @@ -49,7 +50,6 @@ Jekyll::Hooks.register :site, :pre_render, priority: 1 do |site| 
     | 
|
| 
       49 
50 
     | 
    
         
             
              site.pages.each do |page|
         
     | 
| 
       50 
51 
     | 
    
         
             
                case page
         
     | 
| 
       51 
52 
     | 
    
         
             
                when Jekyll::ActivityPub::Activity, Jekyll::ActivityPub::Actor
         
     | 
| 
       52 
     | 
    
         
            -
                  site = page.site
         
     | 
| 
       53 
53 
     | 
    
         
             
                  uri = Addressable::URI.parse page.data['id']
         
     | 
| 
       54 
54 
     | 
    
         
             
                  url = [ Jekyll::ActivityPub::Link.new(site, page.data['url'], 'canonical', 'text/html') ]
         
     | 
| 
       55 
55 
     | 
    
         | 
| 
         @@ -62,9 +62,8 @@ Jekyll::Hooks.register :site, :pre_render, priority: 1 do |site| 
     | 
|
| 
       62 
62 
     | 
    
         
             
                  end
         
     | 
| 
       63 
63 
     | 
    
         | 
| 
       64 
64 
     | 
    
         
             
                  %w[ipns hyper bittorrent].each do |protocol|
         
     | 
| 
       65 
     | 
    
         
            -
                    json = convert_uris(page. 
     | 
| 
       66 
     | 
    
         
            -
             
     | 
| 
       67 
     | 
    
         
            -
                    end
         
     | 
| 
      
 65 
     | 
    
         
            +
                    json = convert_uris(page.pruned_data, site.config['url'], protocol)
         
     | 
| 
      
 66 
     | 
    
         
            +
                    json['url'] = url
         
     | 
| 
       68 
67 
     | 
    
         | 
| 
       69 
68 
     | 
    
         
             
                    uri  = Addressable::URI.parse(json['id'])
         
     | 
| 
       70 
69 
     | 
    
         
             
                    uri.path = uri.path.sub('.jsonld', ".#{protocol}.jsonld")
         
     | 
| 
         @@ -74,9 +73,14 @@ Jekyll::Hooks.register :site, :pre_render, priority: 1 do |site| 
     | 
|
| 
       74 
73 
     | 
    
         
             
                    Jekyll::PageWithoutAFile.new(site, site.source, File.dirname(path), File.basename(path)).tap do |alternate|
         
     | 
| 
       75 
74 
     | 
    
         
             
                      site.pages << alternate
         
     | 
| 
       76 
75 
     | 
    
         | 
| 
       77 
     | 
    
         
            -
                      alternate.content = json.to_json
         
     | 
| 
      
 76 
     | 
    
         
            +
                      alternate.output = alternate.content = json.to_json
         
     | 
| 
       78 
77 
     | 
    
         
             
                    end
         
     | 
| 
       79 
78 
     | 
    
         
             
                  end
         
     | 
| 
      
 79 
     | 
    
         
            +
             
     | 
| 
      
 80 
     | 
    
         
            +
                  page.data['url'] = url
         
     | 
| 
      
 81 
     | 
    
         
            +
                  page.output = page.content
         
     | 
| 
      
 82 
     | 
    
         
            +
             
     | 
| 
      
 83 
     | 
    
         
            +
                  Jekyll.logger.info 'FEP fffd:', 'Generated'
         
     | 
| 
       80 
84 
     | 
    
         
             
                end
         
     | 
| 
       81 
85 
     | 
    
         
             
              end
         
     | 
| 
       82 
86 
     | 
    
         
             
            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.2. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.3
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Sutty
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2024-03- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2024-03-18 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: distributed-press-api-client
         
     |