Yaml front matter in haml file

I am trying to use haml-jekyll-extension only I do not understand how to enable yaml front matter? I have the following:

---
user: hello
---
!!!
%html
  %title RudyIndustries
  %body
    %h1 Hello World! {{ page.user }}

but it ends up compiling into the following html:

user: hello
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <title>RudyIndustries</title>
  <body>
    <h1>Hello World! {{ page.user }}</h1>
  </body>
</html>

How to do to mark the yaml front element so that it compiles in html correctly?

+3
source share
1 answer

Use backslash:

haml file:

\---
user: hello
\---
%html
  %title RudyIndustries
  %body
    %h1 Hello World! {{ page.user }}

compiles into the following html:

---
user: hello
---
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <title>RudyIndustries</title>
  <body>
    <h1>Hello World! {{ page.user }}</h1>
  </body>
</html>
+4
source

All Articles