mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-15 20:44:01 +02:00
Fix JSON array-based data file handling regression
This bug was introduced in Hugo 0.35. Fixes #4361
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
4743de0d3c
commit
4402c07775
@@ -804,7 +804,7 @@ func (s *Site) handleDataFile(r source.ReadableFile) error {
|
||||
|
||||
data, err := s.readData(r)
|
||||
if err != nil {
|
||||
s.Log.WARN.Printf("Failed to read data from %s: %s", filepath.Join(r.Path(), r.LogicalName()), err)
|
||||
s.Log.ERROR.Printf("Failed to read data from %s: %s", filepath.Join(r.Path(), r.LogicalName()), err)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -846,7 +846,7 @@ func (s *Site) readData(f source.ReadableFile) (interface{}, error) {
|
||||
case "yaml", "yml":
|
||||
return parser.HandleYAMLMetaData(content)
|
||||
case "json":
|
||||
return parser.HandleJSONMetaData(content)
|
||||
return parser.HandleJSONData(content)
|
||||
case "toml":
|
||||
return parser.HandleTOMLMetaData(content)
|
||||
default:
|
||||
|
Reference in New Issue
Block a user