I’ve recently been introduced to a static site generator called Middleman. This is a platform for assembling and demoing a site mockup. To see some examples head over to wrapbootstrap.com. When you “build” a middleman site it consolidates all of the js and css files into just 2, well actually you still need all the files from your various plugins and css files but you only include the 2 files in the resources of your XPage.
We’re using jQuery with quite a few plugins and bootstrap:
All of these plugins include their own css files, images, js files, etc. Now we could include all of these files individually in our XPage site, but that would be a waste of time and bandwidth. Not to mention would probably affect performance, which is always a bummer. Middleman allows us to compile all of these plugins into just 2 files which will be included into our site. All of the plugin files, css, images, fonts, etc are still needed but are referenced when needed.
The biggest drawback to this method is the installation of Middleman. It requires Ruby and RubyGems which are included with OSX but I still had a real problem getting it installed. I worked on it off and on over a few weeks in-between tasks until I finally found this article which got me the farthest in the install. Once installed then the fun begins putting together all of your resources and learning how to use Middleman. Middleman is a command line utility and includes some really cool features if you’re putting together a demo site. Honestly, for our purpose all these features aren’t really used, we’re just interested in the consolidation and minification of resources.