Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dannyprose/1470557 to your computer and use it in GitHub Desktop.
Save dannyprose/1470557 to your computer and use it in GitHub Desktop.
Middleman: Complex YAML and Control Structures
/////
/ YAML: data/someStuff.yml
/
/ awsomeStuff:
/ - 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/someStuffMeta.yml
/
/ awsomeStuff:
/ - meta: Awesome Stuff #1 Meta
/ content-tag: a-s-1
/
/ - meta: Awesome Stuff #2
/ content-tag: a-s-2
/
/////
%ul{:class => "items"}
- data.someStuff.awsomeStuff.each do |awesomeStuff|
%li= awesomeStuff[:title]
- if data.someStuffMeta.content-tag == f[:content-tag]
/Ideally it would be better to iterate through this like
/each(), but only return if someStuffMeta.content-tag == f[:content-tag]
%p Awesome Meta!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment