def categories_from_path(special_dir)
      superdirs = relative_path.sub(%r!#{special_dir}(.*)!, "")
        .split(File::SEPARATOR)
        .reject do |c|
        c.empty? || c == special_dir || c == basename
      end
      merge_data!({ "categories" => superdirs }, :source => "file path")
    end
def categories_from_path(special_dir)
      superdirs = relative_path.sub(%r!#{special_dir}(.*)!, "")
        .split(File::SEPARATOR)
        .reject do |c|
        c.empty? || c == special_dir || c == basename
      end
      merge_data!({ "categories" => superdirs }, :source => "file path")
    end
Add superdirectories of the special_dir to categories.
 In the case of es/_posts, 'es' is added as a category.
 In the case of _posts/es, 'es' is NOT added as a category.

 Returns nothing.