-
-
Save mgrandrath/8282339 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Jekyll Generator for SCSS | |
# | |
# (File paths in this description relative to jekyll project root directory) | |
# Place this file in ./_plugins | |
# Place .scss files in ./_scss | |
# Compiles .scss files in ./_scss to .css files in whatever directory you indicated in your config | |
# Config file placed in ./_sass/config.rb | |
require 'compass' | |
require 'compass/exec' | |
module Jekyll | |
class CompassGenerator < Generator | |
safe true | |
def initialize(site_config) | |
super | |
@site_config = site_config | |
end | |
def generate(site) | |
Dir.chdir sass_dir do | |
Compass::Exec::SubCommandUI.new(%w(compile)).run! | |
end | |
site.read_directories(css_path(Compass.configuration)) | |
end | |
private | |
def sass_path | |
'_sass' | |
end | |
def sass_dir | |
File.expand_path(sass_path, base_dir) | |
end | |
def css_path(compass_config) | |
normalize(File.join(sass_path, compass_config.css_dir)) | |
end | |
def base_dir | |
@site_config[:source] | |
end | |
def normalize(path) | |
Pathname.new(path).cleanpath.to_s | |
end | |
end | |
end |
@detly I know I'm probably too late but in case anyone stumbles upon this. The fix is to change: site.read_directories
to site.reader.read_directories
.
@detly I know I'm probably too late but
No, once every four years is about how frequently I update my blog.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I just get: