henrik / jekyll

Jekyll is a blog-aware, static site generator in Ruby
126 stars 39 forks source link

:format option for HAML #5

Open jhindle opened 14 years ago

jhindle commented 14 years ago

Is there currently a way to set the ':format' option for HAML to change the doctype?

Like this: http://haml-lang.com/docs/yardoc/HAML_REFERENCE.md.html#options

This would be good so the doctype could be changed to HTML4 or HTML5

curthasselschwert commented 14 years ago

I was thinking this as well, but you can just do this in your layout:

<!DOCTYPE html>
%html
  %head
    ...
jhindle commented 14 years ago

HAML's :format option also effects how self-closing tags are formatted.

XHTML requires an ending slash:

<img src="foo.jpg" alt="bar" /> 

HTML4 and HTML 5 do not:

<img src="foo.jpg" alt="bar">
curthasselschwert commented 14 years ago

You're right! I hadn't even considered closing tags. I second the idea of the :format option for HAML.

jou commented 14 years ago

I have implemented a way to pass options to Haml in my branch, so you can put this in your _config.yml:

haml_options:
  format: :html5