0

Desired Outcome

I'd like to define a list of contributors to an article from data YML files for each person.

Frontmatter

---
collection: events
format: right-sidebar
layout: events
title: xxxxxxxxxxxxxxxxxxxx
contributors: [david-amerland, denver-prophit]
image: fiction-book-essentials.jpg
categories: technical-seo
tags: semantic-web
is_post: True
excerpt: "xxxxxxxxxxxxxxxxxxxx"
---

Layout

{% for item in site.data.contributors[page.contributors] %}{{item|inspect}}{%endfor%}

Data File

david-amerland.yml

name: David Amerland
url:  https://g.co/kgs/QpjJVr

denver-prophit.yml

name: Denver Prophit
url: https://g.co/kgs/55pDpp

Problem

I can only select one data record. I need a record hash of more than two.

1 Answers1

0

This would be possible if a where in filter were available. It's not the case.

You'll have to loop over each page.contributors and grab datas from site.data.contributors.

{% for contributor in page.contributors %}
  {% assign datas = site.data.contributors[contributor] %}
  Output whatever about current contributor {{ datas.name }}, ...
{% endfor %}
David Jacquel
  • 51,670
  • 6
  • 121
  • 147