module Jekyll::Algolia::FileBrowser

def self.excerpt_html(file)

file - The Jekyll file

Public: Returns the HTML version of the excerpt
def self.excerpt_html(file)
  # If it's a post with a custom separator for the excerpt, we honor it
  return excerpt_raw(file) if use_default_excerpt?(file)
  # Otherwise we take the first matching node
  html = file.content
  selector = Configurator.algolia('nodes_to_index')
  first_node = Nokogiri::HTML(html).css(selector).first
  return nil if first_node.nil?
  first_node.to_s
end