Class: Jekyll::Tags::HamlInclude

Inherits:
IncludeTag
  • Object
show all
Defined in:
lib/jekyll/haml/markup/include.rb

Instance Method Summary collapse

Instance Method Details

#read_file(file, context) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/jekyll/haml/markup/include.rb', line 8

def read_file(file, context)
  content = File.read file, file_read_opts(context)

  config = context.registers[:site].config
  haml_converter = Jekyll::Converters::Haml.new config
  content = haml_converter.convert(content) if haml_converter.matches File.extname(file)

  content
end