class Jekyll::Renderer

Renders a Document

@see jekyll-4.0.0/lib/jekyll/renderer.rb

Public Instance Methods

place_in_layouts(content, payload, info) click to toggle source

Encrypts the content before it's placed into the layout tree

   # File lib/jekyll/renderer.rb
15 def place_in_layouts(content, payload, info)
16   if encrypt?
17     crypto = Crypto.new(site: site, post: document)
18     crypto.encrypt! && crypto.valid?
19   end
20 
21   place_in_layouts_orig document.content, payload, info
22 end
Also aliased as: place_in_layouts_orig
place_in_layouts_orig(content, payload, info)

We redefine this method because it's the last place where we see the Document content before it's placed inside the layouts. We could use a post render hook but it's too late to make modifications to the content.

Alias for: place_in_layouts

Private Instance Methods

encrypt?() click to toggle source
   # File lib/jekyll/renderer.rb
26 def encrypt?
27   return false if document.data['password'] == false
28   return false if document.data['password'] == 'false'
29   return false if document.content.chomp.empty?
30 
31   true
32 end