Class: Bridgetown::Converters::HamlTemplates
- Inherits:
-
Converter
- Object
- Converter
- Bridgetown::Converters::HamlTemplates
- Defined in:
- lib/bridgetown-haml/haml_templates.rb
Instance Method Summary collapse
-
#convert(content, convertible) ⇒ String
Logic to do the Haml content conversion.
Instance Method Details
#convert(content, convertible) ⇒ String
Logic to do the Haml content conversion.
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/bridgetown-haml/haml_templates.rb', line 31 def convert(content, convertible) haml_view = Bridgetown::HamlView.new(convertible) haml_renderer = Tilt::HamlTemplate.new(convertible.relative_path) { content } if convertible.is_a?(Bridgetown::Layout) haml_renderer.render(haml_view) do convertible.current_document_output end else haml_renderer.render(haml_view) end end |