parent
712d8d617d
commit
c6d5a913f1
|
@ -262,19 +262,22 @@ module Jekyll
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Determines how to read a data file.
|
# Determines how to read a data file.
|
||||||
#
|
#
|
||||||
# Returns the contents of the data file.
|
# Returns the contents of the data file.
|
||||||
def read_data_file(path)
|
def read_data_file(path)
|
||||||
case File.extname(path).downcase
|
case File.extname(path).downcase
|
||||||
when '.csv'
|
when '.csv'
|
||||||
CSV.read(path, :headers => true).map(&:to_hash)
|
CSV.read(path, {
|
||||||
|
:headers => true,
|
||||||
|
:encoding => config['encoding']
|
||||||
|
}).map(&:to_hash)
|
||||||
else
|
else
|
||||||
SafeYAML.load_file(path)
|
SafeYAML.load_file(path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Read in all collections specified in the configuration
|
# Read in all collections specified in the configuration
|
||||||
#
|
#
|
||||||
# Returns nothing.
|
# Returns nothing.
|
||||||
|
|
Loading…
Reference in New Issue