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
  is_post = (type(file) == 'post')
  if is_post
    custom_separator = file.excerpt_separator.to_s.strip
    return excerpt_raw(file) unless custom_separator.empty?
  end
  # 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