class Jekyll::Algolia::Site
def write
def write records = [] files = [] Logger.log('I:Extracting records...') each_site_file do |file| path = FileBrowser.relative_path(file) # Skip files that should not be indexed is_indexable = FileBrowser.indexable?(file) unless is_indexable Logger.verbose("W:Skipping #{path}") next end Logger.verbose("I:Extracting records from #{path}") file_records = Extractor.run(file) files << file records += file_records end # Applying the user hook on the whole list of records records = Hooks.apply_all(records) # Adding a unique objectID to each record records.map! do |record| Extractor.add_unique_object_id(record) end Logger.verbose("I:Found #{files.length} files") Indexer.run(records) end