It turns out all you have to do to pass data from a template to a layout is declare an instance variable. So for YAML data like I was doing:
# In your template
<% @my_var = YAML.load_file("path/to/data.yml") %>
# In your layout
<p>My_var contains: <%= @my_var %></p>
I don't know if this is obvious if you're familiar with the tool chain underneath middleman, or if it's in the documentation somewhere and I just couldn't find it, but that's all there is to it.
Thanks so much to @dddd1919 for dropping this knowledge bomb.