more helper tests
This commit is contained in:
parent
9dcac764e6
commit
191e972c44
|
@ -16,10 +16,10 @@ module Middleman
|
||||||
path << self.class.index_file if path.match(%r{/$})
|
path << self.class.index_file if path.match(%r{/$})
|
||||||
path = path.gsub(%r{^/}, '')
|
path = path.gsub(%r{^/}, '')
|
||||||
path = path.gsub(File.extname(path), '')
|
path = path.gsub(File.extname(path), '')
|
||||||
path = path.gsub('/', '-')
|
|
||||||
|
|
||||||
css_file = File.join(File.basename(self.class.public), self.class.css_dir, "#{path}.css")
|
css_file = File.join(self.class.public, self.class.css_dir, "#{path}.css")
|
||||||
sass_file = File.join(File.basename(self.class.views), self.class.css_dir, "#{path}.css.sass")
|
sass_file = File.join(self.class.views, self.class.css_dir, "#{path}.css.sass")
|
||||||
|
|
||||||
if File.exists?(css_file) || File.exists?(sass_file)
|
if File.exists?(css_file) || File.exists?(sass_file)
|
||||||
stylesheet_link_tag "#{path}.css"
|
stylesheet_link_tag "#{path}.css"
|
||||||
end
|
end
|
||||||
|
|
25
spec/fixtures/sample/init.rb
vendored
25
spec/fixtures/sample/init.rb
vendored
|
@ -1,4 +1,29 @@
|
||||||
# enable :maruku
|
# enable :maruku
|
||||||
get "/inline-js.html" do
|
get "/inline-js.html" do
|
||||||
haml :"inline-js.html", :layout => false
|
haml :"inline-js.html", :layout => false
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
get "/page-class.html" do
|
||||||
|
haml :"page-classes.html", :layout => false
|
||||||
|
end
|
||||||
|
|
||||||
|
get "/sub1/page-class.html" do
|
||||||
|
haml :"page-classes.html", :layout => false
|
||||||
|
end
|
||||||
|
|
||||||
|
get "/sub1/sub2/page-class.html" do
|
||||||
|
haml :"page-classes.html", :layout => false
|
||||||
|
end
|
||||||
|
|
||||||
|
get "/auto-css.html" do
|
||||||
|
haml :"auto-css.html", :layout => false
|
||||||
|
end
|
||||||
|
|
||||||
|
get "/sub1/auto-css.html" do
|
||||||
|
haml :"auto-css.html", :layout => false
|
||||||
|
end
|
||||||
|
|
||||||
|
get "/sub1/sub2/auto-css.html" do
|
||||||
|
haml :"auto-css.html", :layout => false
|
||||||
end
|
end
|
Loading…
Reference in a new issue