Allow cascade _target to work with non toml fm
authorGareth Watts <gareth@omnipotent.net>
Thu, 22 Oct 2020 17:14:14 +0000 (12:14 -0500)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 22 Oct 2020 21:00:19 +0000 (23:00 +0200)
commit3400aff2588cbf9dd4629c05537d16b019d0fdf5
treee3714b454b2366f891cdfc746c5e9d9549d3a973
parentfdfa4a5fe62232f65f1dd8d6fe0c500374228788
Allow cascade _target to work with non toml fm

The TOML lib unmarshals slices of string maps to []map[string]interface{}
whereas YAML and JSON decode to []interface{}

The existing tests only check for TOML working correctly, and _target
with cascade did not work at all for frontmatter defined in other formats.

Add a function to normalize those slices

Fixes #7874
common/maps/maps.go
common/maps/maps_test.go
hugolib/cascade_test.go
hugolib/page__meta.go