views:

28

answers:

1

In my Jekyll blog I use the include tag to put the contents of a file into the document. However if I attempt to do this with a HAML based document the indentation of the included text is wrong. :preserve does not work because it requires indentation. Is there a way to specify a block of text without depending on indentation?

%html
  %body
    - preserve do
<strong>included text from file</strong>
    - end
+1  A: 

For text, use filters:

:text
  some text
:erb
  <%= render :partial ... %>

http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#filters

Josiah Kiehl
I thought `render` was a rails thing not jekyll.
Sukima
Will this work for inserting raw HTML?
Sukima
Yep, use the :erb filter for raw HTML as ERB extends HTML.
Josiah Kiehl