module Jekyll::Algolia::FileBrowser

def self.excluded_from_config?(file)

file - The Jekyll file

Public: Check if the file has been excluded by `files_to_exclude`
def self.excluded_from_config?(file)
  excluded_patterns = Configurator.algolia('files_to_exclude')
  jekyll_source = Configurator.get('source')
  path = absolute_path(file.path)
  excluded_patterns.each do |pattern|
    pattern = File.expand_path(File.join(jekyll_source, pattern))
    return true if File.fnmatch(pattern, path, File::FNM_PATHNAME)
  end
  false
end