My understanding is that the extension mechanism changed with Middleman 3.1. Is the tutorial about Custom Extensions still relevant? If not, is there somewhere I can find an example of the new style extensions?
I’m also curious about this. The guide shows one way of doing it. But bundle exec middleman extension foo
produces an awesome scaffold, but the scaffold works in a very different way than the guide explains.
Just wondering which is the more correct style, the guide or the scaffold?
Thanks!
The command line extension
generator looks like it’s intended to be used to create a scaffold for a extension intended for distribution via rubygems; that’s why it includes a .gemspec
and a features
directory (for tests using Cucumber, run via the Rakefile
generated with the scaffolds).
To my eyes, aside from the directory structure and those files I mentioned above, the actual “meat” of the scaffolded extension is pretty much the same as in the current tutorial linked above, so I’d think they’re both current and accurate.
@tommysundstrom — as far as I can tell, the biggest change in the extension mechanism is that now you inherit from a Middleman::Extension
base class. In terms of how you author extensions and what’s documented, most everything else seems the same to me.
Thank you, adamesque!