A little help with Local Data

I am just starting to play around with ruby and Middleman.

Right now, I am trying to understand the Local Data operations.

Using the sample people.yaml:

    friends:
  - Tom
  - Dick
  - Harry

Everything works, using the:

<% data.people.friends.each do |f| %>

My question is trying to use:

friends:
  - Tom
  - Dick
  - Harry
  
best_friend: Steve

How do you output best_friend?

Everything I have tried breaks my page.

And, every example I have seem across the net uses lists, and not a single item.

Thanks in advance!

If there are no errors in your yaml file, you should be able to use

<%= data.people.best_friend %>

This will output Steve

Hello @br4ndon

Here is a little trick if you want to make a loop and tests a variable : you can use .present?

https://github.com/flexbox/webcitation/blob/master/source/index.html.slim

Yahoooo! It works now.

The issue was within my YAML code.

Thanks guys for the tips!