Styling the Blog Article Page

I’ve successfully setup a blog on my site and generated two test articles. When I go to http://mydomain.com/blog, I get a list if my two articles with a ‘read’ more link. Now, this is where I am lost. The link takes you to the real article, but the html page the article is in was created with markdown, so how do I add header, title, date, auther and general style to that page?

I hope this makes sences to those of you much smarter than me :smile:

Thank you for the help.

Chuck

Chuck,

Makes sense to me as it took me a bit of time to wrap my head around the way middleman works… the doc’s have a few holes in them if your not fully ingrained into the way middleman works. I’m heading to work shortly so I’m sure this isn’t going to come off as clear as I hope.

Please assume post[ing] and article are essential the same here. I think of a blog entry as a post, and a non-blog page as an article…

The basic shipped getting started layout runs everything thru the source/layout.erb template. You have a few different choices how you could proceed. You could put some logic in the default layout to pull some data out of the frontmatter you could make a separate template or you could use a partial like layout with layout_wrap that is then embedded into the default layout.

Since I was/am moving from jekyll to middleman everyone of my postings had layout: post in the frontmatter so I chose to create a new layout called post.erb in source/layouts and do something like:

<% wrap_layout :layout do %>
    <%= partial "_post_entry", locals: {post: current_article} %>
<% end %>

the the partial _post_entry preforms the layout for both the main page along with the individual posting pages. I’m sure this had some flaws but it works for me, for now… oh… and to grab the data in the frontmatter you would do something like:

<%= current_article.data.title %>
<%= current_article.date.strftime('%b %d') %>

I hope this helps with your question.

@mitchejj That worked like a charm!!! Thank you. And yes, you are correct - it takes a bot to wrap the mind around around MM.

Thank you for your help.