From daf217567f22febb7432c661f15fc0ad43b9818a Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Fri, 8 Jul 2011 13:23:06 -0700 Subject: [PATCH] Add Redcarpet YAML support --- lib/middleman/core_extensions/front_matter.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/middleman/core_extensions/front_matter.rb b/lib/middleman/core_extensions/front_matter.rb index e73b3931..5450a793 100644 --- a/lib/middleman/core_extensions/front_matter.rb +++ b/lib/middleman/core_extensions/front_matter.rb @@ -7,10 +7,20 @@ module Middleman::CoreExtensions::FrontMatter app.extend ClassMethods ::Tilt::register RDiscountTemplate, 'markdown', 'mkd', 'md' + ::Tilt::register RedcarpetTemplate, 'markdown', 'mkd', 'md' + ::Tilt.prefer(RDiscountTemplate) + ::Tilt::register RedClothTemplate, 'textile' + ::Tilt.prefer(RedClothTemplate) + ::Tilt::register ERBTemplate, 'erb', 'rhtml' + ::Tilt.prefer(ERBTemplate) + ::Tilt::register SlimTemplate, 'slim' + ::Tilt.prefer(SlimTemplate) + ::Tilt::register HamlTemplate, 'haml' + ::Tilt.prefer(HamlTemplate) app.before do result = resolve_template(request.path_info, :raise_exceptions => false) @@ -64,6 +74,9 @@ module Middleman::CoreExtensions::FrontMatter class RDiscountTemplate < ::Tilt::RDiscountTemplate include Middleman::CoreExtensions::FrontMatter::YamlAware end + class RedcarpetTemplate < ::Tilt::RedcarpetTemplate + include Middleman::CoreExtensions::FrontMatter::YamlAware + end class RedClothTemplate < ::Tilt::RedClothTemplate include Middleman::CoreExtensions::FrontMatter::YamlAware