markaby submodule
This commit is contained in:
parent
4371ade28c
commit
e3751e1448
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
[submodule "vendor/sinatra-markaby"]
|
||||||
|
path = vendor/sinatra-markaby
|
||||||
|
url = git://github.com/sbfaulkner/sinatra-markaby.git
|
1
Rakefile
1
Rakefile
|
@ -14,7 +14,6 @@ begin
|
||||||
gem.executables = %w(sm-init sm-build sm-server)
|
gem.executables = %w(sm-init sm-build sm-server)
|
||||||
gem.add_dependency("templater")
|
gem.add_dependency("templater")
|
||||||
gem.add_dependency("sinatra")
|
gem.add_dependency("sinatra")
|
||||||
gem.add_dependency("sbfaulkner-sinatra-markaby")
|
|
||||||
gem.add_dependency("haml", ">=2.1.0")
|
gem.add_dependency("haml", ">=2.1.0")
|
||||||
gem.add_dependency("chriseppstein-compass")
|
gem.add_dependency("chriseppstein-compass")
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,9 @@ require 'rubygems'
|
||||||
require 'haml'
|
require 'haml'
|
||||||
require 'compass' #must be loaded before sinatra
|
require 'compass' #must be loaded before sinatra
|
||||||
require 'sinatra/base'
|
require 'sinatra/base'
|
||||||
require 'sinatra/markaby'
|
|
||||||
|
# Include markaby support
|
||||||
|
require File.join(File.dirname(__FILE__), '..', 'vendor', 'sinatra', 'markaby')
|
||||||
|
|
||||||
class Middleman < Sinatra::Base
|
class Middleman < Sinatra::Base
|
||||||
set :app_file, __FILE__
|
set :app_file, __FILE__
|
||||||
|
@ -42,6 +44,7 @@ class Middleman < Sinatra::Base
|
||||||
def render_haml_or_sass(path)
|
def render_haml_or_sass(path)
|
||||||
if path.match /.html$/
|
if path.match /.html$/
|
||||||
haml(path.gsub('.html', '').to_sym)
|
haml(path.gsub('.html', '').to_sym)
|
||||||
|
#markaby
|
||||||
elsif path.match /.css$/
|
elsif path.match /.css$/
|
||||||
content_type 'text/css', :charset => 'utf-8'
|
content_type 'text/css', :charset => 'utf-8'
|
||||||
sass(path.gsub('.css', '').to_sym, Compass.sass_engine_options)
|
sass(path.gsub('.css', '').to_sym, Compass.sass_engine_options)
|
||||||
|
@ -52,13 +55,7 @@ class Middleman < Sinatra::Base
|
||||||
path = path.gsub(%r{^/}, '')
|
path = path.gsub(%r{^/}, '')
|
||||||
path = "index.html" if path == ''
|
path = "index.html" if path == ''
|
||||||
|
|
||||||
if path.match /.html$/
|
if !render_haml_or_sass(path)
|
||||||
haml(path.gsub('.html', '').to_sym)
|
|
||||||
#markaby
|
|
||||||
elsif path.match /.css$/
|
|
||||||
content_type 'text/css', :charset => 'utf-8'
|
|
||||||
sass(path.gsub('.css', '').to_sym, Compass.sass_engine_options)
|
|
||||||
else
|
|
||||||
pass
|
pass
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
1
vendor/sinatra-markaby
vendored
Submodule
1
vendor/sinatra-markaby
vendored
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 654e41735fcc021fe5682a10485e676331497f4e
|
Loading…
Reference in a new issue