How to override article.tt in Middleman Blog Gem?

The middleman blog gem creates new articles based on lib/middleman-blog/commands/article.tt Current format is is;

---
title: <%= @title %>
date: <%= @date.strftime('%F %R %Z') %>
tags:
---

What is the best way to override that if I wanted default front matter to be something else like;

---
layout: blog
author: Dave
---

(Other than opening the gem and changing it there.)

Read the docs here: http://middlemanapp.com/basics/blogging/#generating-articles
You can create your own template and store it with the project.

Thanks for your help!

That solved the majority of my questions, but what would you suggest for dynamically creating front matter variables?

For example;

---
layout: <%= @layout_from_flag %>
month: <%= @month %>
---

AFAIK there is no solution for that, unfortunately. The less elegant workaround/solution is to set the metadata in the page code, after frontmatter. This is described here: Generate extra data for resources . I remember there was some confusion about when to use metadata and when data – some of this is read-only AFAIR, in case of problems google this forum for more info.

But I think in most cases you can avoid the need to use variables in frontmatter. Where I need them mostly is to dynamically set the page title and other HTML-metadata, but instead fighting with Middleman’s metadata I just use a capture helper.

In my layout.erb I have:

<html>
<head>
<% if content_for?(:head_assets) %>
<%= yield_content :head_assets %>
<% else %>
  <title><%= current_page.data.title %></title>
  <%= feed_tag :atom, "#{blog.options.prefix.to_s}/feed.xml", title: "Atom Feed" %>
  <meta name="description" content="<%= data.project_config.site_description %>" />
  <meta property="og:title" content="<%= current_page.data.title %>" />
  <meta property="og:description" content="<%= data.project_config.site_description %>" />
<% end %>

and some of my pages use static title, some create it dynamically:

<% content_for :head_assets do %>
  …
<% end %>

Where would values of @month come from?