Class: Jekyll::ActivityPub::PublicKey
- Inherits:
-
Page
- Object
- Page
- Jekyll::ActivityPub::PublicKey
- Includes:
- Helper
- Defined in:
- lib/jekyll/activity_pub/public_key.rb
Overview
Public key
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(site, actor, public_key, base = '', dir = '', name = 'pubkey.pem') ⇒ PublicKey
constructor
Initialize with default data.
- #read_yaml ⇒ Object
Methods included from Helper
#generate_excerpt?, #hook_owner, #locale, #place_in_layout?, #pruned_data, #render_with_liquid?, #to_json, #to_liquid, #trigger_hooks
Constructor Details
#initialize(site, actor, public_key, base = '', dir = '', name = 'pubkey.pem') ⇒ PublicKey
Initialize with default data
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/jekyll/activity_pub/public_key.rb', line 21 def initialize(site, actor, public_key, base = '', dir = '', name = 'pubkey.pem') @context = StubContext.new(registers: { site: site }) @actor = actor @public_key = public_key super(site, base, dir, name) actor.data['publicKey'] = self Notifier.public_key_url = data['id'] trigger_hooks :post_init end |
Instance Method Details
#content ⇒ Object
43 44 45 |
# File 'lib/jekyll/activity_pub/public_key.rb', line 43 def content data['publicKeyPem'] end |
#read_yaml ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/jekyll/activity_pub/public_key.rb', line 35 def read_yaml(*) self.data = { 'id' => "#{absolute_url(@actor.url)}#main-key", 'owner' => absolute_url(@actor.url), 'publicKeyPem' => @public_key.public_to_pem } end |