Forked from dannyprose/middleman-complex-YAML-and-control-structures.haml
Created
December 13, 2011 05:24
Revisions
-
tdreyno revised this gist
Dec 13, 2011 . 1 changed file with 12 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,34 +1,33 @@ ///// / 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! -
dannyprose created this gist
Dec 13, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ ///// / 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!