Skip to content

Is it possible to nest (and loop over) data in frontmatter? #595

Answered by bakerkretzmar
nathangross asked this question in Q&A
Discussion options

You must be logged in to vote

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:

subcollection:
  - title: 'Voluptate minim Lorem nulla esse eiusmod dolore amet ad nulla'
    text: 'Ipsum in aliquip veniam occaecat Lorem non fugiat ipsum consequat deserunt.'
  - title: 'Reprehenderit sunt officia voluptate anim voluptate non'
    text: 'Dolor veniam ex do deserunt esse ex cupidatat labore est reprehenderit elit culpa.'

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nathangross
Comment options

Answer selected by nathangross
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants