diff --git a/middleman-core/lib/middleman-core/sitemap/store.rb b/middleman-core/lib/middleman-core/sitemap/store.rb index 499a74a2..f6f43fb0 100644 --- a/middleman-core/lib/middleman-core/sitemap/store.rb +++ b/middleman-core/lib/middleman-core/sitemap/store.rb @@ -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 diff --git a/middleman-more/lib/middleman-more/renderers/haml.rb b/middleman-more/lib/middleman-more/renderers/haml.rb index 96989063..f0fced39 100644 --- a/middleman-more/lib/middleman-more/renderers/haml.rb +++ b/middleman-more/lib/middleman-more/renderers/haml.rb @@ -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 diff --git a/middleman-more/lib/middleman-more/renderers/liquid.rb b/middleman-more/lib/middleman-more/renderers/liquid.rb index b85e78f4..24981039 100644 --- a/middleman-more/lib/middleman-more/renderers/liquid.rb +++ b/middleman-more/lib/middleman-more/renderers/liquid.rb @@ -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) diff --git a/middleman-more/lib/middleman-more/renderers/markdown.rb b/middleman-more/lib/middleman-more/renderers/markdown.rb index e2182e91..018b3cf7 100644 --- a/middleman-more/lib/middleman-more/renderers/markdown.rb +++ b/middleman-more/lib/middleman-more/renderers/markdown.rb @@ -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 diff --git a/middleman-more/lib/middleman-more/renderers/sass.rb b/middleman-more/lib/middleman-more/renderers/sass.rb index fc9285bc..60fa039b 100644 --- a/middleman-more/lib/middleman-more/renderers/sass.rb +++ b/middleman-more/lib/middleman-more/renderers/sass.rb @@ -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 diff --git a/middleman-more/lib/middleman-more/renderers/slim.rb b/middleman-more/lib/middleman-more/renderers/slim.rb index e7ace334..f378c195 100644 --- a/middleman-more/lib/middleman-more/renderers/slim.rb +++ b/middleman-more/lib/middleman-more/renderers/slim.rb @@ -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