lib/awestruct/handlers/base_tilt_handler.rb in awestruct-0.5.7.RC2 vs lib/awestruct/handlers/base_tilt_handler.rb in awestruct-0.5.7

- old
+ new

@@ -12,11 +12,11 @@ # if no portions of the path are registered to a Tilt template or the # Tilt template cannot be loaded. def match(path) matcher = ::Tilt[File.basename(path)] if matcher.nil? - $LOG.warn(%(Copying #{path})) if $LOG.warn? && Awestruct::Engine.instance.config.verbose + $LOG.debug(%(Copying #{path})) if Awestruct::Engine.instance.config.verbose return false end # We have our own extra integration with Asciidoctor return false if matcher.name.include? 'Asciidoctor' @@ -132,22 +132,26 @@ c } return template.render(context) rescue LoadError => e error_page = context[:page] - ExceptionHelper.log_message "Could not load template library required for rendering #{File.join site.dir, error_page.source_path}." - ExceptionHelper.log_message "Please see #{File.join site.dir, error_page.output_path} for more information" + ExceptionHelper.log_message "Could not load template library required for rendering #{error_page.source_path}." + ExceptionHelper.log_message "Please see #{error_page.output_path} for more information" return ExceptionHelper.html_error_report e, error_page.source_path rescue => e error_page = context[:page] - if error_page[:__is_layout] == true - ExceptionHelper.log_message "An error during rendering layout file #{File.join site.dir, error_page.source_path} occurred." + if error_page[:__is_layout] == true || context[:__is_layout] == true + ExceptionHelper.log_message "An error during rendering layout file #{context[:__effective_page].relative_source_path} for #{error_page.relative_source_path} occurred." ExceptionHelper.log_building_error e, error_page.source_path + + elsif error_page.is_partial? + ExceptionHelper.log_message "An error during rendering partial file #{error_page.relative_source_path} for #{error_page[:real_page].relative_source_path} occurred." + ExceptionHelper.log_building_error e, error_page[:real_page].source_path else - ExceptionHelper.log_message "An error during rendering #{File.join site.dir, error_page.source_path} occurred." + ExceptionHelper.log_message "An error during rendering #{error_page.relative_source_path} occurred." ExceptionHelper.log_building_error e, error_page.source_path end - ExceptionHelper.log_message "Please see #{File.join site.dir, error_page.output_path} for more information" + ExceptionHelper.log_message "Please see .awestruct/error.log for more information" return ExceptionHelper.html_error_report e, error_page.source_path end end end end