Module: Jekyll::DistorteD::Molecule::LastResort

Includes:
Cooltrainer::DistorteD::InjectionOfLove
Defined in:
lib/distorted-jekyll/molecule/lastresort.rb

Constant Summary collapse

LOWER_WORLD =
CHECKING::YOU::IN('application/x.distorted.last-resort')
ATTRIBUTES =
Set[:alt, :title, :href, :caption]
ATTRIBUTES_DEFAULT =
{}
ATTRIBUTES_VALUES =
{}

Instance Method Summary collapse

Instance Method Details

#render_to_output_buffer(context, output) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/distorted-jekyll/molecule/lastresort.rb', line 26

def render_to_output_buffer(context, output)
  super
  begin
    output << parse_template.render({
      'name' => @name,
      'basename' => File.basename(@name, '.*'),
      'path' => @relative_dest,
      'alt' => abstract(:alt),
      'title' => abstract(:title),
      'href' => abstract(:href),
      'caption' => abstract(:caption),
    })
  rescue Liquid::SyntaxError => l
    unless Jekyll.env == 'production'.freeze
      output << parse_template(name: 'error_code'.freeze).render({
        'message' => l.message,
      })
    end
  end
  output
end