From 0309753561469817041882ffb578c74e3e388437 Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Fri, 30 May 2014 22:04:32 -0700 Subject: [PATCH] Change when file listeners are registered in order to make cache invalidation work --- .../middleman-core/sitemap/extensions/on_disk.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/middleman-core/lib/middleman-core/sitemap/extensions/on_disk.rb b/middleman-core/lib/middleman-core/sitemap/extensions/on_disk.rb index b259c43e..de9569ce 100644 --- a/middleman-core/lib/middleman-core/sitemap/extensions/on_disk.rb +++ b/middleman-core/lib/middleman-core/sitemap/extensions/on_disk.rb @@ -15,14 +15,16 @@ module Middleman scoped_self = self @waiting_for_ready = true - # Register file change callback - @app.files.changed do |file| - scoped_self.touch_file(file) - end + @app.before_configuration do + # Register file change callback + files.changed do |file| + scoped_self.touch_file(file) + end - # Register file delete callback - @app.files.deleted do |file| - scoped_self.remove_file(file) + # Register file delete callback + files.deleted do |file| + scoped_self.remove_file(file) + end end @app.ready do