Implied extensions. Closes #304
This commit is contained in:
parent
e769477e93
commit
183e9d68f3
|
@ -178,10 +178,13 @@ module Middleman::Sitemap
|
|||
|
||||
# If there is no extension, look for one
|
||||
if File.extname(path).empty?
|
||||
input_ext = File.extname(file).split(".").last.to_sym
|
||||
input_ext = File.extname(file)
|
||||
|
||||
if app.template_extensions.has_key?(input_ext)
|
||||
path << ".#{app.template_extensions[input_ext]}"
|
||||
if !input_ext.empty?
|
||||
input_ext = input_ext.split(".").last.to_sym
|
||||
if app.template_extensions.has_key?(input_ext)
|
||||
path << ".#{app.template_extensions[input_ext]}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -11,6 +11,10 @@ module Middleman::Renderers::Haml
|
|||
# Add haml helpers to context
|
||||
app.send :include, ::Haml::Helpers
|
||||
|
||||
app.before_configuration do
|
||||
template_extensions :haml => :html
|
||||
end
|
||||
|
||||
# Setup haml helper paths
|
||||
app.ready do
|
||||
init_haml_helpers
|
||||
|
|
|
@ -13,6 +13,10 @@ module Middleman::Renderers::Liquid
|
|||
# Require Gem
|
||||
require "liquid"
|
||||
|
||||
app.before_configuration do
|
||||
template_extensions :liquid => :html
|
||||
end
|
||||
|
||||
# After config, setup liquid partial paths
|
||||
app.after_configuration do
|
||||
Liquid::Template.file_system = Liquid::LocalFileSystem.new(source_dir)
|
||||
|
|
|
@ -18,6 +18,14 @@ module Middleman::Renderers::Markdown
|
|||
app.set :markdown_engine, :redcarpet
|
||||
app.set :markdown_engine_prefix, ::Tilt
|
||||
|
||||
app.before_configuration do
|
||||
template_extensions :markdown => :html,
|
||||
:mdown => :html,
|
||||
:md => :html,
|
||||
:mkd => :html,
|
||||
:mkdn => :html
|
||||
end
|
||||
|
||||
# Once configuration is parsed
|
||||
app.after_configuration do
|
||||
|
||||
|
|
|
@ -16,6 +16,11 @@ module Middleman::Renderers::Sass
|
|||
def registered(app)
|
||||
# Default sass options
|
||||
app.set :sass, {}
|
||||
|
||||
app.before_configuration do
|
||||
template_extensions :scss => :css,
|
||||
:sass => :css
|
||||
end
|
||||
end
|
||||
|
||||
alias :included :registered
|
||||
|
|
|
@ -12,6 +12,10 @@ module Middleman::Renderers::Slim
|
|||
# Load gem
|
||||
require "slim"
|
||||
|
||||
app.before_configuration do
|
||||
template_extensions :slim => :html
|
||||
end
|
||||
|
||||
# Setup Slim options to work with partials
|
||||
Slim::Engine.set_default_options(:buffer => '@_out_buf', :generator => Temple::Generators::StringBuffer) if defined?(Slim)
|
||||
rescue LoadError
|
||||
|
|
Loading…
Reference in a new issue