module Jekyll::Algolia::FileBrowser

def self.use_default_excerpt?(file)

if it seems to be what the user wants
element), but in some cases, we'll fallback to Jekyll's default excerpt
Most of the time, we'll use our own excerpt (the first matching

file - The Jekyll file

this file
Public: Return true if the Jekyll default excerpt should be used for
def self.use_default_excerpt?(file)
  # Only posts can have excerpt
  return false unless type(file) == 'post'
  # User defined their own separator in the config
  custom_separator = file.excerpt_separator.to_s.strip
  return false if custom_separator.empty?
  # This specific post contains this separator
  file.content.include?(custom_separator)
end