lib/nanoc/helpers/rendering.rb in nanoc-4.3.0 vs lib/nanoc/helpers/rendering.rb in nanoc-4.3.1
- old
+ new
@@ -11,13 +11,14 @@
# @raise [Nanoc::Int::Errors::UnknownFilter]
#
# @return [String, nil]
def render(identifier, other_assigns = {}, &block)
# Find layout
- layout = @layouts[identifier]
- layout ||= @layouts[identifier.__nanoc_cleaned_identifier]
- raise Nanoc::Int::Errors::UnknownLayout.new(identifier) if layout.nil?
+ layout_view = @layouts[identifier]
+ layout_view ||= @layouts[identifier.__nanoc_cleaned_identifier]
+ raise Nanoc::Int::Errors::UnknownLayout.new(identifier) if layout_view.nil?
+ layout = layout_view.unwrap
# Visit
dependency_tracker = @config._context.dependency_tracker
dependency_tracker.bounce(layout)
@@ -28,11 +29,11 @@
assigns = {
content: captured_content,
item: @item,
item_rep: @item_rep,
items: @items,
- layout: layout,
+ layout: layout_view,
layouts: @layouts,
config: @config,
}.merge(other_assigns)
# Get filter name
@@ -49,10 +50,10 @@
begin
# Notify start
Nanoc::Int::NotificationCenter.post(:processing_started, layout)
# Layout
- content = layout.unwrap.content
+ content = layout.content
arg = content.binary? ? content.filename : content.string
result = filter.setup_and_run(arg, filter_args)
# Append to erbout if we have a block
if block_given?