class Jekyll::Tags::HamlInclude
include module
Public Instance Methods
read_file(file, context)
click to toggle source
Calls superclass method
# File lib/jekyll/haml/markup/include.rb, line 8 def read_file(file, context) return super file, context unless matches_a_haml_template file file_content = read_file_with_context file, context template = split_frontmatter_and_template file_content compile_haml_to_html template end
Private Instance Methods
compile_haml_to_html(template)
click to toggle source
# File lib/jekyll/haml/markup/include.rb, line 30 def compile_haml_to_html(template) Jekyll::Haml::Parser.compile template end
matches_a_haml_template(file)
click to toggle source
# File lib/jekyll/haml/markup/include.rb, line 17 def matches_a_haml_template(file) Jekyll::Haml::Parser.matches File.extname file end
read_file_with_context(file, context)
click to toggle source
# File lib/jekyll/haml/markup/include.rb, line 21 def read_file_with_context(file, context) File.read file, **file_read_opts(context) end
split_frontmatter_and_template(file_content)
click to toggle source
# File lib/jekyll/haml/markup/include.rb, line 25 def split_frontmatter_and_template(file_content) return $POSTMATCH if file_content =~ Document::YAML_FRONT_MATTER_REGEXP file_content end