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:
parent
d4272cf098
commit
182dee5ecb
1 changed files with 3 additions and 1 deletions
|
@ -12,8 +12,10 @@ TemplateInheritance::Template.paths << File.join(Dir.pwd, "content")
|
||||||
|
|
||||||
module Ace
|
module Ace
|
||||||
class TemplateFilter < Filter
|
class TemplateFilter < Filter
|
||||||
|
TEMPLATE_EXTS_PATTERN = /\.(haml|erb|erubis)$/i
|
||||||
|
|
||||||
def call(item, content)
|
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(".")
|
item.output_path = item.output_path.split(".")[0..-2].join(".")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue