Class: Jekyll::ActivityPub::OrderedCollectionPage

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

Overview

A collection of activities

Instance Attribute Summary collapse

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, outbox, base = '', dir = 'outbox', name = 'page.jsonld') ⇒ OrderedCollectionPage

Initialize with default data

Parameters:



21
22
23
24
25
26
27
28
# File 'lib/jekyll/activity_pub/ordered_collection_page.rb', line 21

def initialize(site, outbox, base = '', dir = 'outbox', name = 'page.jsonld')
  @context = StubContext.new(registers: { site: site })
  @outbox = outbox

  super(site, base, dir, name)

  trigger_hooks :post_init
end

Instance Attribute Details

#outboxObject (readonly)

Returns the value of attribute outbox.



12
13
14
# File 'lib/jekyll/activity_pub/ordered_collection_page.rb', line 12

def outbox
  @outbox
end

Instance Method Details

#read_yamlObject



30
31
32
33
34
35
36
37
38
# File 'lib/jekyll/activity_pub/ordered_collection_page.rb', line 30

def read_yaml(*)
  self.data = {
    '@context' => 'https://www.w3.org/ns/activitystreams',
    'id' => absolute_url(url),
    'type' => 'OrderedCollectionPage',
    'partOf' => absolute_url(outbox.url),
    'orderedItems' => []
  }
end