Haml Walkthrough: HTML

We’re not going to go through the HTML-to-Haml conversion in detail like the previous ERB one. We just want to see how the stylistic changes can also be applied to a static site.

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/
 xhtml1-transitional.dtd">
 <html xmlns=​"http://www.w3.org/1999/xhtml"
 xml:lang=​"en"​>
  <head>
  <meta http-equiv=​"Content-Type"​ content=​"text/html;
 charset=UTF-8"​ />
  <title>​<​%= @title || “Awesome Site” %></title>
  </head>
  <body>
  <div id=​'wrapper'​>
  <div id=​'header'​>
  <h1>Awesome Site</h1>
  </div>
  <div id=​'content'​>
 <​%= yield %>
  </div>
  <div id=​'footer'​>
  <small>Copyright Hampton Lintorn ...

Get Pragmatic Guide to Sass 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.