This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rake tasks to parse haml layouts, includes and index files for jekyll | |
# Assumes that the haml files are in (_layouts|_includes|_posts)/_haml | |
namespace :haml do | |
require 'haml' | |
def convert file, destination | |
base_name = File.basename(file, '.haml') + '.html' | |
html = File.open(file, 'r') { |f| Haml::Engine.new(f.read).render } | |
File.open(File.join(destination, base_name), 'w') { |f| f.write html } |