lib/awestruct/extensions/sitemap.rb in awestruct-0.5.4.rc vs lib/awestruct/extensions/sitemap.rb in awestruct-0.5.4.rc2
- old
+ new
@@ -1,10 +1,11 @@
# Generates a sitemap for search engines. Defaults to /sitemap.xml
# Ignores images, css, robots, atoms, javascript files.
# Add a sitemap.yml file to add files that for one reason or
# another won't be hanging off of site (e.g. they're in .htaccess)
require 'ostruct'
+require 'awestruct/util/exception_helper'
module Awestruct
module Extensions
class Sitemap
@@ -72,10 +73,10 @@
page.lastmod = Time.parse( page.date ).strftime( "%Y-%m-%d" )
else
page.lastmod = date.strftime( "%Y-%m-%d" )
end
rescue Exception => e
- $LOG.error "Cannot parse date #{date.to_s}: #{e}" if $LOG.error?
+ ExceptionHelper.log_building_error e, page.relative_source_path
end
else
page.lastmod = Time.now.strftime( "%Y-%m-%d" )
end
end