module Jekyll::Algolia::FileBrowser
def self.slug(file)
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