I pulled this out of [`Middleman::Templates::Local`](https://github.com/middleman/middleman/blob/master/middleman-templates/lib/middleman-templates/local.rb#L17-L28) when I stumbled on it. @tdreyno might be best placed explaining it but a short version would be this.

require all `template.rb`s in [`~/.middleman](https://github.com/middleman/middleman/blob/master/middleman-templates/lib/middleman-templates/local.rb#L6-L8). Require them if found (therefore registering them) else register the folder as a `Local` template ([which when built, just copies the folder](https://github.com/middleman/middleman/blob/master/middleman-templates/lib/middleman-templates/local.rb#L12-L14)).