Undefined method when accessing data files

I have an “undefined method” issue I can’t find the answer to.

In my layout file I have a “files: test” field which is the name of a test.yml file in my data dir.
Trying to access data in this test.yml file with the below code produces an “undefined method `f’” error.

<% f=current_page.data.files %>
<h3><%= data.f.items.first %></h3>

f resolves to ‘test’, and data.test.items.first works, but the above line doesn’t.

I am guessing this is a simple error, but I don’t know where to look to resolve it.
Can somebody please:

a) let me know how to resolve this
b) point me in the right direction for documentation to help me figure out these problems myself

thanks

Instead of data.f.items.first you should probably have f.items.first.

Thanks. Removing “data” changes the error to the following.

undefined method `items' for "test":String

A Class mismatch? I should probably provide the full error message from my first post:

undefined method `f' for #<Middleman::CoreExtensions::Data::DataStore:0x9d17988>