Class: Bridgetown::Converters::SerbeaTemplates
- Inherits:
-
Bridgetown::Converter
- Object
- Plugin
- Bridgetown::Converter
- Bridgetown::Converters::SerbeaTemplates
- Defined in:
- bridgetown-core/lib/bridgetown-core/converters/serbea_templates.rb
Instance Method Summary collapse
-
#convert(content, convertible) ⇒ String
Logic to do the Serbea content conversion.
Methods inherited from Bridgetown::Converter
#determine_template_engine, #initialize, input, #inspect, #line_start, #matches, #output_ext, support_slots, supports_slots?, template_engine
Methods inherited from Plugin
Methods included from Prioritizable
Constructor Details
This class inherits a constructor from Bridgetown::Converter
Instance Method Details
#convert(content, convertible) ⇒ String
Logic to do the Serbea content conversion
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'bridgetown-core/lib/bridgetown-core/converters/serbea_templates.rb', line 35 def convert(content, convertible) serb_view = Bridgetown::SerbeaView.new(convertible) serb_renderer = convertible.site.tmp_cache["serb-tmpl:#{convertible.path}:#{content.hash}"] ||= Tilt::SerbeaTemplate.new( convertible.path, line_start(convertible) ) { content } if convertible.is_a?(Bridgetown::Layout) serb_renderer.render(serb_view) do convertible.current_document_output end else serb_renderer.render(serb_view) end end |