def read_data_file(path)
      case File.extname(path).downcase
      when ".csv"
        CSV.read(path,
                 :headers  => true,
                 :encoding => site.config["encoding"]).map(&:to_hash)
      when ".tsv"
        CSV.read(path,
                 :col_sep  => "\t",
                 :headers  => true,
                 :encoding => site.config["encoding"]).map(&:to_hash)
      else
        SafeYAML.load_file(path)
      end
    end
def read_data_file(path)
      case File.extname(path).downcase
      when ".csv"
        CSV.read(path,
                 :headers  => true,
                 :encoding => site.config["encoding"]).map(&:to_hash)
      when ".tsv"
        CSV.read(path,
                 :col_sep  => "\t",
                 :headers  => true,
                 :encoding => site.config["encoding"]).map(&:to_hash)
      else
        SafeYAML.load_file(path)
      end
    end
Determines how to read a data file.

 Returns the contents of the data file.