diff --git a/features/slim.feature b/features/slim.feature
new file mode 100644
index 00000000..e3d2975d
--- /dev/null
+++ b/features/slim.feature
@@ -0,0 +1,7 @@
+Feature: Support slim templating language
+ In order to offer an alternative to Haml
+
+ Scenario: Rendering Slim
+ Given the Server is running
+ When I go to "/slim.html"
+ Then I should see "
Welcome to Slim
"
\ No newline at end of file
diff --git a/fixtures/test-app/config.rb b/fixtures/test-app/config.rb
index ea851387..b91191ed 100644
--- a/fixtures/test-app/config.rb
+++ b/fixtures/test-app/config.rb
@@ -2,6 +2,7 @@ with_layout false do
page "/inline-css.html"
page "/inline-js.html"
page "/inline-coffeescript.html"
+ page "/slim.html"
end
get "/page-class.html" do
diff --git a/fixtures/test-app/source/slim.html.slim b/fixtures/test-app/source/slim.html.slim
new file mode 100644
index 00000000..e13e5b60
--- /dev/null
+++ b/fixtures/test-app/source/slim.html.slim
@@ -0,0 +1,7 @@
+doctype 5
+html lang='en'
+ head
+ meta charset="utf-8"
+
+ body
+ h1 Welcome to Slim
\ No newline at end of file
diff --git a/lib/middleman.rb b/lib/middleman.rb
index a105a77a..9d2eb39d 100755
--- a/lib/middleman.rb
+++ b/lib/middleman.rb
@@ -67,6 +67,7 @@ module Middleman
module Renderers
autoload :Haml, "middleman/renderers/haml"
autoload :Sass, "middleman/renderers/sass"
+ autoload :Slim, "middleman/renderers/slim"
end
# Features API
diff --git a/lib/middleman/renderers/slim.rb b/lib/middleman/renderers/slim.rb
new file mode 100644
index 00000000..175ef8eb
--- /dev/null
+++ b/lib/middleman/renderers/slim.rb
@@ -0,0 +1,12 @@
+module Middleman
+ module Renderers
+ module Slim
+ class << self
+ def registered(app)
+ require "slim"
+ end
+ alias :included :registered
+ end
+ end
+ end
+end
\ No newline at end of file
diff --git a/lib/middleman/server.rb b/lib/middleman/server.rb
index 96b97c25..0a844669 100644
--- a/lib/middleman/server.rb
+++ b/lib/middleman/server.rb
@@ -73,6 +73,7 @@ module Middleman
end
# Activate custom renderers
+ register Middleman::Renderers::Slim
register Middleman::Renderers::Haml
register Middleman::Renderers::Sass
diff --git a/middleman.gemspec b/middleman.gemspec
index 40947443..81a35b99 100644
--- a/middleman.gemspec
+++ b/middleman.gemspec
@@ -29,6 +29,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency("padrino-helpers", ["~> 0.9.23"])
s.add_runtime_dependency("rack-test", ["~> 0.5.0"])
s.add_runtime_dependency("uglifier", ["~> 0.5.0"])
+ s.add_runtime_dependency("slim", ["~> 0.9.4"])
s.add_runtime_dependency("haml", ["~> 3.1.0"])
s.add_runtime_dependency("coffee-filter", ["~> 0.1.0"])
s.add_runtime_dependency("sass", ["~> 3.1.0"])