Sha256: ccf12019cbd869df1f39f7fd5709efc584baf95ad89cb8b5a55829d5a6d42e42

Contents?: true

Size: 1.07 KB

Versions: 9

Compression:

Stored size: 1.07 KB

Contents

require 'awestruct/handlers/base_tilt_handler'
require 'awestruct/handlers/file_handler'
require 'awestruct/handlers/front_matter_handler'
require 'awestruct/handlers/layout_handler'

require 'compass'

module Awestruct
  module Handlers
    class CssTiltHandler < BaseTiltHandler

      CHAIN = Awestruct::HandlerChain.new(/\.(sass|scss|less)$/,
        Awestruct::Handlers::FileHandler,
        Awestruct::Handlers::CssTiltHandler
      )

      def initialize(site, delegate)
        super( site, delegate )
      end

      ##
      # Sass Engine requires dynamically generated options.
      ##
      def options
        opts = super

        # Sass / Scss
        opts[:load_paths] ||= []
        Compass::Frameworks::ALL.each do |framework|
          opts[:load_paths] << framework.stylesheets_directory
        end
        opts[:load_paths] << File.join(site.config.dir.to_s, File.dirname(relative_source_path) ) unless relative_source_path.nil?

        # Less use Paths instead of load_paths
        opts[:paths] = opts[:load_paths]

        return opts
      end

    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
awestruct-0.5.4.rc3 lib/awestruct/handlers/css_tilt_handler.rb
awestruct-0.5.4.rc2 lib/awestruct/handlers/css_tilt_handler.rb
awestruct-0.5.4.rc lib/awestruct/handlers/css_tilt_handler.rb
awestruct-0.5.4.beta1 lib/awestruct/handlers/css_tilt_handler.rb
awestruct-0.5.3 lib/awestruct/handlers/css_tilt_handler.rb
awestruct-0.5.2.1 lib/awestruct/handlers/css_tilt_handler.rb
awestruct-0.5.2 lib/awestruct/handlers/css_tilt_handler.rb
awestruct-0.5.1 lib/awestruct/handlers/css_tilt_handler.rb
awestruct-0.5.1a lib/awestruct/handlers/css_tilt_handler.rb