Class: Jekyll::ActivityPub::Nodeinfo

Inherits:
Page
  • Object
show all
Includes:
Helper
Defined in:
lib/jekyll/activity_pub/nodeinfo.rb

Overview

Points to site’s nodeinfo

Instance Method Summary collapse

Methods included from Helper

#content, #generate_excerpt?, #hook_owner, #locale, #place_in_layout?, #pruned_data, #render_with_liquid?, #to_json, #to_liquid, #trigger_hooks

Constructor Details

#initialize(site, nodeinfos, base = '', dir = '.well-known', name = 'webfinger') ⇒ Nodeinfo

Initialize with default data

Parameters:

  • :site (Jekyll::Site)
  • :nodeinfos (Array<Nodeinfo21>)
  • :base (String)
  • :dir (String)
  • :name (String)


19
20
21
22
23
24
25
26
# File 'lib/jekyll/activity_pub/nodeinfo.rb', line 19

def initialize(site, nodeinfos, base = '', dir = '.well-known', name = 'webfinger')
  @context = StubContext.new(registers: { site: site })
  @nodeinfos = nodeinfos

  super(site, base, dir, name)

  trigger_hooks :post_init
end

Instance Method Details

The nodeinfo file is expected to be at this location always

Returns:

  • (String)


35
36
37
# File 'lib/jekyll/activity_pub/nodeinfo.rb', line 35

def permalink
  '.well-known/nodeinfo'
end

#read_yamlObject



28
29
30
# File 'lib/jekyll/activity_pub/nodeinfo.rb', line 28

def read_yaml(*)
  self.data = { 'links' => @nodeinfos.map(&:to_jrd) }
end