lib/jekyll/watcher.rb in jekyll-watch-1.1.2 vs lib/jekyll/watcher.rb in jekyll-watch-1.2.0

- old
+ new

@@ -50,17 +50,22 @@ def custom_excludes(options) Array(options['exclude']).map { |e| Jekyll.sanitized_path(options['source'], e) } end + def config_files(options) + %w[yml yaml toml].map do |ext| + Jekyll.sanitized_path(options['source'], "_config.#{ext}") + end + end + def to_exclude(options) - config_files = [ - "_config.yml", - "_config.yaml", - "_config.toml" - ].map { |config_file| Jekyll.sanitized_path(options['source'], config_file) } - [config_files, options['destination'], custom_excludes(options)].flatten + [ + config_files(options), + options['destination'], + custom_excludes(options) + ].flatten end # Paths to ignore for the watch option # # options - A Hash of options passed to the command @@ -82,10 +87,10 @@ end rescue ArgumentError # Could not find a relative path end end - end.compact + end.compact + [/\.jekyll\-metadata/] end end end