Is it possible to nest (and loop over) data in frontmatter? #595
Answered
by
bakerkretzmar
nathangross
asked this question in
Q&A
-
As far as I can tell, nesting collections is not currently supported (#579) but I was curious if you could achieve something similar with nested frontmatter data? I saw this post regarding a different SSG. I was hoping something like this would work but it doesn't' seem to.
Are there any good ways, currently, to nest like this? |
Beta Was this translation helpful? Give feedback.
Answered by
bakerkretzmar
Nov 12, 2021
Replies: 1 comment 1 reply
-
That actually does work, but each nested item will be an array, not an object: - {{ $item->title }}
+ {{ $item['title'] }} Also, this doesn't seem to actually matter, but I think technically your nested YAML items should be indented further:
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
nathangross
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That actually does work, but each nested item will be an array, not an object:
Also, this doesn't seem to actually matter, but I think technically your nested YAML items should be indented further: