module Jekyll::Algolia::FileBrowser

def self.slug(file)

files, we have to create them from the basename
Slugs can be automatically extracted from collections, but for other

file - The Jekyll file

Public: Returns the slug of the file
def self.slug(file)
  # We get the real slug from the file data if available
  return file.data['slug'] if file.data.key?('slug')
  # We create it ourselves from the filepath otherwise
  File.basename(file.path, File.extname(file.path)).downcase
end