# _plugins/haml_converter.rb | |
module Jekyll | |
class HamlConverter < Converter | |
safe true | |
def setup | |
return if @setup | |
require 'haml' | |
@setup = true | |
rescue | |
STDERR.puts 'do `gem install haml`' | |
raise FatalException.new("Missing dependency: haml") | |
end | |
def matches(ext) | |
ext =~ /haml/i | |
end | |
def output_ext(ext) | |
".html" | |
end | |
def convert(content) | |
setup | |
engine = Haml::Engine.new(content) | |
engine.render | |
end | |
end | |
end |
--- | |
layout: home | |
title: Home Page | |
--- | |
%h1 Hello World? |
This comment has been minimized.
This comment has been minimized.
I don't think so. There is an open ticket here: jekyll/jekyll#53 For now, you'll have to pre-process your Haml before sending it to Github pages. This is not too bad if you can set up your development environment to automatically compile the HAML whenever you save. |
This comment has been minimized.
This comment has been minimized.
bcardarella
commented
Jun 27, 2011
How are you pre-processing the HAML? |
This comment has been minimized.
This comment has been minimized.
georgedrummond
commented
Jun 27, 2011
see line 24 onwards |
This comment has been minimized.
This comment has been minimized.
@bcardarella Since |
This comment has been minimized.
This comment has been minimized.
jfrux
commented
Nov 4, 2013
Does |
This comment has been minimized.
This comment has been minimized.
topher6345
commented
Jan 20, 2014
This plguin isn't converting my haml layouts to html But it works for the content pages, any ideas? |
This comment has been minimized.
This comment has been minimized.
jalcine
commented
Aug 29, 2014
@topher6345 what's the suffix of your layout files? Might wanna make them |
This comment has been minimized.
This comment has been minimized.
2xG
commented
Apr 29, 2015
I have an error with new version of haml gem. |
This comment has been minimized.
georgedrummond commentedJun 2, 2011
will this work with github pages?