From b8886b7f43351d092b8148c5b62c07009b986b3e Mon Sep 17 00:00:00 2001 From: tdreyno Date: Tue, 4 Aug 2009 12:18:05 -0700 Subject: [PATCH] fix compass filters --- lib/middleman.rb | 23 +++++++++++++---------- lib/middleman/helpers.rb | 4 ++++ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/middleman.rb b/lib/middleman.rb index fa26b037..55e8164d 100644 --- a/lib/middleman.rb +++ b/lib/middleman.rb @@ -50,16 +50,6 @@ class Middleman < Sinatra::Base puts "== The Middleman is already standing watch on port #{port}!" end - configure do - Compass.configuration do |config| - config.project_path = Dir.pwd - config.sass_dir = File.join(File.expand_path(self.views), "stylesheets") - config.output_style = :nested - config.images_dir = File.join(File.basename(self.public), "images") - config.http_images_path = "/images/" - end - end - # Check for local config local_config = File.join(self.root, "init.rb") if File.exists? local_config @@ -67,6 +57,19 @@ class Middleman < Sinatra::Base class_eval File.read(local_config) end + configure do + Compass.configuration do |config| + config.project_path = Dir.pwd + config.sass_dir = File.join(File.basename(self.views), "stylesheets") + config.output_style = :nested + config.images_dir = File.join(File.basename(self.public), "images") + config.http_images_path = "/images/" + config.add_import_path(config.sass_dir) + end + + Compass.configure_sass_plugin! + end + get /(.*)/ do |path| path << "index.html" if path.match(%r{/$}) path.gsub!(%r{^/}, '') diff --git a/lib/middleman/helpers.rb b/lib/middleman/helpers.rb index 69805dd0..630c4ebc 100644 --- a/lib/middleman/helpers.rb +++ b/lib/middleman/helpers.rb @@ -14,4 +14,8 @@ Middleman.helpers do classes += additional unless additional.empty? classes.join(' ') end + + def asset_url(path, tld_length = 1) + "/#{path}" + end end