fix esoteric image path bug

This commit is contained in:
Thomas Reynolds 2011-06-14 13:54:59 -07:00
parent d2e7dde496
commit d17fa7b71b
2 changed files with 13 additions and 1 deletions

View file

@ -50,7 +50,7 @@ module Middleman::Features::DefaultHelpers
else kind.to_s else kind.to_s
end end
source = source.to_s.gsub(/\s/, '') source = source.to_s.gsub(/\s/, '')
ignore_extension = (asset_folder.to_s == kind.to_s) # don't append extension ignore_extension = (kind == :images) # don't append extension
source << ".#{kind}" unless ignore_extension or source =~ /\.#{kind}/ source << ".#{kind}" unless ignore_extension or source =~ /\.#{kind}/
result_path = source if source =~ %r{^/} # absolute path result_path = source if source =~ %r{^/} # absolute path
result_path ||= asset_url(source, asset_folder) result_path ||= asset_url(source, asset_folder)

View file

@ -6,12 +6,15 @@ module Middleman::Features::FrontMatter
def registered(app) def registered(app)
app.extend ClassMethods app.extend ClassMethods
::Tilt::register MarukuTemplate, 'markdown', 'mkd', 'md'
::Tilt::register MarukuTemplate, 'markdown', 'mkd', 'md' ::Tilt::register MarukuTemplate, 'markdown', 'mkd', 'md'
::Tilt::register KramdownTemplate, 'markdown', 'mkd', 'md' ::Tilt::register KramdownTemplate, 'markdown', 'mkd', 'md'
::Tilt::register BlueClothTemplate, 'markdown', 'mkd', 'md' ::Tilt::register BlueClothTemplate, 'markdown', 'mkd', 'md'
::Tilt::register RedcarpetTemplate, 'markdown', 'mkd', 'md' ::Tilt::register RedcarpetTemplate, 'markdown', 'mkd', 'md'
::Tilt::register RDiscountTemplate, 'markdown', 'mkd', 'md' ::Tilt::register RDiscountTemplate, 'markdown', 'mkd', 'md'
::Tilt::register RedClothTemplate, 'textile' ::Tilt::register RedClothTemplate, 'textile'
::Tilt::register ERBTemplate, 'erb', 'rhtml'
::Tilt::register ErubisTemplate, 'erb', 'rhtml', 'erubis'
end end
alias :included :registered alias :included :registered
end end
@ -66,4 +69,13 @@ module Middleman::Features::FrontMatter
class RedClothTemplate < ::Tilt::RedClothTemplate class RedClothTemplate < ::Tilt::RedClothTemplate
include Middleman::Features::FrontMatter::YamlAware include Middleman::Features::FrontMatter::YamlAware
end end
# ERb
class ERBTemplate < ::Tilt::ERBTemplate
include Middleman::Features::FrontMatter::YamlAware
end
class ErubisTemplate < ::Tilt::ErubisTemplate
include Middleman::Features::FrontMatter::YamlAware
end
end end