class Middleman::Sitemap::Store
def file_to_path(file)
-
(String)
-
Parameters:
-
file
(String
) --
def file_to_path(file) file = File.join(@app.root, file) prefix = @app.source_dir.sub(/\/$/, "") + "/" return false unless file.start_with?(prefix) path = file.sub(prefix, "") # Replace a file name containing automatic_directory_matcher with a folder unless @app.config[:automatic_directory_matcher].nil? path = path.gsub(@app.config[:automatic_directory_matcher], "/") end extensionless_path(path) end