lib/jekyll-maps/location_finder.rb in jekyll-maps-1.1.2 vs lib/jekyll-maps/location_finder.rb in jekyll-maps-1.1.3

- old
+ new

@@ -4,12 +4,16 @@ def initialize(options) @documents = [] @options = options end - def find(site) - site.collections.each { |_, collection| filter(collection.docs) } - site.data.each { |_, docs| filter(docs) } + def find(site, page) + if @options[:flags][:on_page] + @documents << page if location?(page) + else + site.collections.each { |_, collection| filter(collection.docs) } + site.data.each { |_, docs| filter(docs) } + end @documents.map do |document| { :latitude => document["location"]["latitude"], :longitude => document["location"]["longitude"],