Class: Bridgetown::ERBView
- Inherits:
-
RubyTemplateView
- Object
- RubyTemplateView
- Bridgetown::ERBView
- Includes:
- ERBCapture
- Defined in:
- lib/bridgetown-core/converters/erb_templates.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from RubyTemplateView
#content, #layout, #paginator, #resource, #site
Instance Method Summary collapse
- #_render_partial(partial_name, options) ⇒ Object
- #h(input) ⇒ Object
- #partial(partial_name = nil, **options, &block) ⇒ Object
Methods included from ERBCapture
Methods inherited from RubyTemplateView
#collections, #data, #helpers, #initialize, #inspect, #liquid_render, #method_missing, #render, #respond_to_missing?, #site_drop
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
90 91 92 93 94 95 96 97 98 99 |
# File 'lib/bridgetown-core/converters/erb_templates.rb', line 90 def _render_partial(partial_name, ) partial_path = _partial_path(partial_name, "erb") tmpl = site.tmp_cache["partial-tmpl:#{partial_path}"] ||= Tilt::ErubiTemplate.new( partial_path, outvar: "@_erbout", bufval: "Bridgetown::OutputBuffer.new", engine_class: ERBEngine ) tmpl.render(self, ) end |
#h(input) ⇒ Object
78 79 80 |
# File 'lib/bridgetown-core/converters/erb_templates.rb', line 78 def h(input) Erubi.h(input) end |
#partial(partial_name = nil, **options, &block) ⇒ Object
82 83 84 85 86 87 88 |
# File 'lib/bridgetown-core/converters/erb_templates.rb', line 82 def partial(partial_name = nil, **, &block) partial_name = [:template] if partial_name.nil? && [:template] .merge!([:locals]) if [:locals] [:content] = capture(&block) if block _render_partial partial_name, end |