Closed pixeldesu closed 1 week ago
Hmmm, that's not possible right now. Let me think of a way to implement it.
I just released a new version v0.7.0
that allows to do that.
You only have to set the name []
to indicate that this value is an array without a key. Your example would be:
cms.document("buttons", "src:_data/buttons.yaml", [
{
name: "[]",
type: "object-list",
fields: [
{
name: "title",
type: "text"
},
{
name: "url",
type: "url"
},
{
name: "image",
type: "file",
uploads: "buttons"
}
]
}
]);
My site is composed from a lot of files inside
_data
that don't have an explicit key in YAML.For example, I do have a
_data/buttons.yaml
that looks like so:Since I need a list of items the
object-list
field is probably what I need to go for...but whatname
do I need to pick, if it's even supported?Because configuring it like so, by the assumption that
buttons
is also the global data key that I can access the items with in Lume (regularly), doesn't workTo aid with issue reproduction, I created a
cms
branch in my website repository with my configuration: https://github.com/pixeldesu/pixelde.su/tree/cms