middleman - Consuming markdown inside yaml -
i'm doing first website middleman , it's raising questions me. 1 of if acceptable or/and right approach.
my site ir organized so:
data about.yml carrer.yml ... source en index.html.erb career index.html.erb ... config.rb gemfile gemfile.lock
i wish consume .yml html.erb file inside yaml have this:
pt: slides: - url: "/images/url.png" markdown: "#heading one" - url: "/images/url.png" markdown: "#heading one" - url: "/images/url.png" markdown: "#heading one" en: slides: - url: "/images/nocturna_new_lisbon_bridge_2.jpg" --- markdown: #heading oness ####heading 4 --- - url: "/images/url.png" markdown: "#heading one" - url: "/images/url.png" markdown: "#heading one"
no problem on pt
version how can make more complicated markdown on en
version? doesn't work...
finally on index.html.erb have somewhere in page:
<% data.homepage_carousel.en.slides.each_with_index |f, index| %> <div class="item <%='active' if index == 0 %>" style="background-image:url(<%= f.url %>)"> <div class="carousel-caption"> <%= markdown f.markdown %><!-- calling helper--> </div> </div> <% end %>
and ok...
looks it:
en: slides: - url: "/images/nocturna_new_lisbon_bridge_2.jpg" markdown: > #heading oness ####heading 4 ...
the extra-lines ad spaces looking > @ beginning of var.
Comments
Post a Comment