equivalentideas
equivalentideas

Reputation: 325

Jekyll post 'belongs_to' post/collection object

In Jekyll is it possible to related a post to one or many specific posts or objects from a collection? And access their yaml data and content?

Upvotes: 0

Views: 73

Answers (1)

Bud Parr
Bud Parr

Reputation: 484

Without knowing the details of exactly what you're trying to do I can only give you a general example.

You can use the "where" filter

{% assign  related_thing = site.[collection] | where: 'yaml_value', yaml_key %}

then run a for loop over related_thing

Hope that helps

Upvotes: 1

Related Questions