1

I'm trying to print my front matter to the page, but I'm having a problem printing this nested data to the page.

.md file

gallery:
   row:
      image: { url: 'img.jpg', ratio: '1.7486338798' }
      image: { url: 'img.jpg', ratio: '1.7486338798' }

post.html

{% for img in page.gallery.row.image %}
  <img src="{{ img.url }}" alt="" data-aspect-ratio="{{ img.ratio }}" />
{% endfor %}

Nothing's showing up in my HTML output. Am I doing something wrong here? Am I nesting Front Matter in YAML correctly?

Any help is appreciated. Thanks in advance!

realph
  • 4,481
  • 13
  • 49
  • 104

1 Answers1

1

Had someone help me out over on the Jekyll Github Page. Answer below:

I seemed to be redefining the hash. The below method works:

gallery:
   row:
      image:
        - { url: 'img.jpg', ratio: '1.7486338798' }
        - { url: 'img.jpg', ratio: '1.7486338798' }
realph
  • 4,481
  • 13
  • 49
  • 104