Do not remove extension if it doesn't end with .haml, .erb or .erubis. This is useful when you already redefined #output_path.

This commit is contained in:
Jakub Stastny aka botanicus 2011-03-03 15:58:18 +00:00
parent d4272cf098
commit 182dee5ecb

View file

@ -12,8 +12,10 @@ TemplateInheritance::Template.paths << File.join(Dir.pwd, "content")
module Ace
class TemplateFilter < Filter
TEMPLATE_EXTS_PATTERN = /\.(haml|erb|erubis)$/i
def call(item, content)
if item.output_path
if item.output_path.match(TEMPLATE_EXTS_PATTERN)
item.output_path = item.output_path.split(".")[0..-2].join(".")
end