Lately I've been using the excellent Middleman static site generator for a few projects, but having a certain distaste for Ruby, I've been giving some thought to building a Grails plugin for this task. A quick search didn't yield any existing plugins that could do this, so I may just give it a go.
The way this would work is to create a normal Grails application and somehow fill it with data (e.g. with the Fixtures plugin or from an actual database) and then call a script provided by this new plugin. This script would start the Grails application and crawl it as defined by a set of conventions and rules, saving the resulting HTML pages in a folder.
My first dilemma is over the best way of defining these rules. One would be to simply use the UrlMappings.groovy
file, e.g.
"/book/list"(controller: 'book', action: 'list')
"/book/$book"(controller: 'book', action: 'show')
...would result in single HTML file for the list action and one HTML for each Book instance as returned b