Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdreyno/1470738 to your computer and use it in GitHub Desktop.
Save tdreyno/1470738 to your computer and use it in GitHub Desktop.
Middleman: Complex YAML and Control Structures
/////
/ YAML: data/some_stuff.yml
/
/ awesome_stuff:
/ - title: Awesome Stuff #1
/ author: Danny Palmer
/ content_tag: a-s-1
/
/ - title: Awesome Stuff #2
/ author: Danny Palmer2
/ content_tag: a-s-2
/
/////
/////
/ YAML: data/some_stuff_meta.yml
/
/ awesome_stuff:
/ - meta: Awesome Stuff #1 Meta
/ content_tag: a-s-1
/
/ - meta: Awesome Stuff #2
/ content_tag: a-s-2
/
/////
%ul{:class => "items"}
- data.some_stuff.awesome_stuff.each_with_index do |awesome_stuff, i|
%li
= awesome_stuff[:title]
- if data.some_stuff_meta[i].content_tag == awesome_stuff.content_tag
%p Awesome Meta!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment