Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9257625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:11:29+00:00 2026-06-18T12:11:29+00:00

I’m working on a static site using middleman and am trying to use mm’s

  • 0

I’m working on a static site using middleman and am trying to use mm’s local data functionality.

Currently I have the required data directory within the source directory of my middleman project.

Inside the data directroy is a yaml file (home.yml)

Here’s the structure of the file:

slides:
    - image: "/img/slider/slide1.jpg"
      image_alt: "Slide 1 alt text"
      caption: "Slide 1 caption"

    - image: "/img/slider/slide2.jpg"
      image_alt: "Slide 2 alt text"
      caption: "Slide 2 caption"

I’m then trying to loop through those slides in a html.erb file like so:

<%= data.home.slides.each do |s| %>

    <figure class="slide">

        <%= image_tag(s[:image], alt: s[:image_alt]) %>

        <figcaption><%= s[:caption] %></figcaption>

    </figure>

<% end %>

But middleman spits a NoMethodError on the compiled html file.

undefined method `home’ for #<Middleman::CoreExtensions::Data::DataStore:0x4383918>

I don’t know what I’m doing wrong. I tried moving the data directory up a level outside of the source folder but that did nothing.

It seems like middleman doesn’t recognise the home.yml folder in side the data directory.
Any help with this is much appreciated as I’ve found there’s not much in the way of documentation or support for middleman’s data functionality.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T12:11:29+00:00Added an answer on June 18, 2026 at 12:11 pm

    You were pretty close — you just had a minor typo. Note how I removed the equals “=” sign.

    Change this line:

    <%= data.home.slides.each do |s| %>
    

    to this:

    <% data.home.slides.each do |s| %>
    

    The following markup should be generated once this is done:

    <figure class="slide">
        <img alt="Slide 1 alt text" src="/img/slider/slide1.jpg">
        <figcaption>Slide 1 caption</figcaption>
    </figure>
    
    <figure class="slide">
        <img alt="Slide 2 alt text" src="/img/slider/slide2.jpg">
        <figcaption>Slide 2 caption</figcaption>
    </figure>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have thousands of HTML files to process using Groovy/Java and I need to
I am trying to loop through a bunch of documents I have to put
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am using jsonparser to parse data and images obtained from json response. When
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.