Search code examples
rubymarkdownpartialmiddleman

Middleman not rendering markdown and erb


I'm working on a project using Middleman. In one of the pages (videos.html.markdown.erb), I'd like to add partials working with both markdown and Middleman helpers.

<h3><%= video.title %> : Récit de tournage</h3>
  <%= partial "partials/shootandlook1"  %>
</div>

It works fine except that Markdown is not converting into HTML... :-(
I named my partial _shootandlook1.html.markdown.erb and my page videos.html.markdown.erb.
I really don't understand what I did wrong... Could someone please help me? The whole source code is here. Many, many thanks in advance!


Solution

  • This should work fine if you name your page template file videos.html.erb, and name your content partial _shootandlook1.md.

    The Markdown file will be processed first, then inserted into the ERB template appropriately.

    I usually find that it's best to avoid having multiple template formats in one file, unless the format explicitly supports blocks (like Haml)