Class: Bridgetown::SerbeaView

Inherits:
ERBView show all
Includes:
Serbea::Helpers
Defined in:
bridgetown-core/lib/bridgetown-core/converters/serbea_templates.rb

Instance Attribute Summary

Attributes inherited from RubyTemplateView

#content, #layout, #paginator, #resource, #site

Instance Method Summary collapse

Methods inherited from ERBView

#h, #partial

Methods inherited from RubyTemplateView

#collections, #data, #helpers, #initialize, #inspect, #liquid_render, #method_missing, #partial, #render, #respond_to_missing?, #site_drop

Methods included from Streamlined

#helper

Methods included from ERBCapture

#capture

Constructor Details

This class inherits a constructor from Bridgetown::RubyTemplateView

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Bridgetown::RubyTemplateView

Instance Method Details

#_render_partial(partial_name, options) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'bridgetown-core/lib/bridgetown-core/converters/serbea_templates.rb', line 10

def _render_partial(partial_name, options)
  partial_path = _partial_path(partial_name, "serb")
  site.tmp_cache["partial-tmpl:#{partial_path}"] ||= {
    signal: site.config.fast_refresh ? Signalize.signal(1) : nil,
  }
  tmpl = site.tmp_cache["partial-tmpl:#{partial_path}"]
  tmpl.template ||= Tilt::SerbeaTemplate.new(partial_path)
  tmpl.signal&.value # subscribe so resources are attached to this partial within effect
  tmpl.template.render(self, options)
end