Class: Jekyll::Commands::Notify

Inherits:
Jekyll::Command
  • Object
show all
Defined in:
lib/jekyll/commands/notify.rb

Overview

Send Activity Pub notifications

Class Method Summary collapse

Class Method Details

.init_with_program(prog) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/jekyll/commands/notify.rb', line 11

def init_with_program(prog)
  prog.command(:notify) do |c|
    c.syntax      'notify'
    c.description 'Send ActivityPub notifications'

    add_build_options(c)

    c.action do |_, options|
      process_with_graceful_fail(c, options, self)
    end
  end
end

.process(options) ⇒ Object

Send notifications



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/jekyll/commands/notify.rb', line 27

def process(options)
  # Adjust verbosity quickly
  Jekyll.logger.adjust_verbosity(options)

  options = configuration_from_options(options)
  site = Jekyll::Site.new(options)

  # Retrocompatibility
  if site.reader.respond_to? :read_data
    site.reader.read_data
  else
    site.data = DataReader.new(site).read(site.config['data_dir'])
  end

  Jekyll::ActivityPub::Notifier.site = site
  Jekyll::ActivityPub::Notifier.notify!
end