mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
more helper tests
This commit is contained in:
parent
9dcac764e6
commit
191e972c44
2 changed files with 28 additions and 3 deletions
|
@ -16,10 +16,10 @@ module Middleman
|
|||
path << self.class.index_file if path.match(%r{/$})
|
||||
path = path.gsub(%r{^/}, '')
|
||||
path = path.gsub(File.extname(path), '')
|
||||
path = path.gsub('/', '-')
|
||||
|
||||
css_file = File.join(File.basename(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")
|
||||
css_file = File.join(self.class.public, self.class.css_dir, "#{path}.css")
|
||||
sass_file = File.join(self.class.views, self.class.css_dir, "#{path}.css.sass")
|
||||
|
||||
if File.exists?(css_file) || File.exists?(sass_file)
|
||||
stylesheet_link_tag "#{path}.css"
|
||||
end
|
||||
|
|
25
spec/fixtures/sample/init.rb
vendored
25
spec/fixtures/sample/init.rb
vendored
|
@ -1,4 +1,29 @@
|
|||
# enable :maruku
|
||||
get "/inline-js.html" do
|
||||
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
|
Loading…
Reference in a new issue