diff --git a/lib/jekyll/converters/scss.rb b/lib/jekyll/converters/scss.rb index 0044f32..c3f25c1 100644 --- a/lib/jekyll/converters/scss.rb +++ b/lib/jekyll/converters/scss.rb @@ -172,7 +172,11 @@ def convert(content) result rescue ::Sass::CompileError => e Jekyll.logger.error e.full_message - raise SyntaxError, e.message + if livereload? && e.respond_to?(:to_css) + e.to_css + else + raise SyntaxError, e.message + end end private @@ -184,6 +188,11 @@ def associate_page_failed? !sass_page end + # Returns `true` if jekyll is serving with livereload. + def livereload? + !!@config["serving"] && !!@config["livereload"] + end + # The URL of the input scss (or sass) file. This information will be used for error reporting. def sass_file_url return if associate_page_failed?