: This gem provides the ability to generate multiple targets by outfitting Middleman with additional command line options. The provided helpers make it simple to control content that is specific to each target, based on the target name or based on feature sets for each target.
It is standalone and can be used in any Middleman project.
Install the Gem
Install the gem in your preferred way, typically:
gem install middleman-targets
From git source:
The complete documentation leverages the features of this gem in order to better document them. Having installed the gem, read the full documentation in your web browser:
middleman-targets documentation cd middleman-targets-docs/ bundle install bundle exec middleman server
And then open your web browser to the address specified (typically
Middleman 4.1.6 or newer is required. Earlier point versions of Middleman do not have the necessary support for this extension.
Once setup and configured, you can build multiple targets like so:
bundle exec middleman build --target mytarget
bundle exec middleman build_all
bundle exec middleman serve --target mytarget
To support multiple targets and features, flexible configuration and helpers are available, including
image_tagsupport chooses target-specific assets for you.
image_tagsupport conditionally includes assets specific to targets or features that you designate.
target_name?()helper allows you to selectively include or exclude content on a per-target basis.
target_feature?()helper allows fined-grained control over included content by managing features of a target instead of a target per se.
- Front matter
excludearrays can ensure entire pages are included or excluded on a target and/or feature specific basis.
- …and more.
Generate YARD documentation:
This Middleman extension is a critical part of Middlemac, the Mac OS X help building system for Mac OS X applications. However this gem is not Mac OS X specific and can be useful in any application for which you want to generate multiple targets.
CHANGELOG.md for point changes, or simply have a look at
the commit history for non-version changes (such as readme updates).