class Middleman::SearchExtension

Public Instance Methods

manipulate_resource_list(resources) click to toggle source
# File lib/middleman-search/extension.rb, line 15
def manipulate_resource_list(resources)
  resources.push Middleman::Sitemap::SearchIndexResource.new(@app.sitemap, @options[:index_path], @options)
  resources
end
search_index_path() click to toggle source
# File lib/middleman-search/extension.rb, line 28
def search_index_path
  (config || app.config)[:http_prefix] + sitemap.find_resource_by_path(extensions[:search].options[:index_path]).destination_path
end
search_lunr_js_pipeline() click to toggle source
# File lib/middleman-search/extension.rb, line 21
def search_lunr_js_pipeline
  # Thanks http://stackoverflow.com/a/20187415/12791
  extensions[:search].options[:pipeline].map do |name, function|
    "lunr.Pipeline.registerFunction(#{function}, '#{name}');"
  end.join("\n")
end