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')
  # Transform the glob patterns into a real list of files
  excluded_files = []
  Dir.chdir(jekyll_source) do
    excluded_patterns.each do |pattern|
      Dir.glob(pattern).each do |match|
        excluded_files << File.expand_path(match)
      end
    end
  end
  excluded_files.include?(absolute_path(file))
end