Skip to content

Instantly share code, notes, and snippets.

Revisions

  1. tdreyno revised this gist Dec 13, 2011. 1 changed file with 12 additions and 13 deletions.
    25 changes: 12 additions & 13 deletions middleman-complex-YAML-and-control-structures.haml
    Original file line number Diff line number Diff line change
    @@ -1,34 +1,33 @@
    /////
    / YAML: data/someStuff.yml
    / YAML: data/some_stuff.yml
    /
    / awsomeStuff:
    / awesome_stuff:
    / - title: Awesome Stuff #1
    / author: Danny Palmer
    / content-tag: a-s-1
    / content_tag: a-s-1
    /
    / - title: Awesome Stuff #2
    / author: Danny Palmer2
    / content-tag: a-s-2
    / content_tag: a-s-2
    /
    /////
    /////
    / YAML: data/someStuffMeta.yml
    / YAML: data/some_stuff_meta.yml
    /
    / awsomeStuff:
    / awesome_stuff:
    / - meta: Awesome Stuff #1 Meta
    / content-tag: a-s-1
    / content_tag: a-s-1
    /
    / - meta: Awesome Stuff #2
    / content-tag: a-s-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]
    - 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!

  2. @dannyprose dannyprose created this gist Dec 13, 2011.
    34 changes: 34 additions & 0 deletions middleman-complex-YAML-and-control-structures.haml
    Original 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!