Sunday, July 15, 2012

Using Grails to create static HTML sites

From time to time I've had to update static web sites, and after editing identical html over and over again in multiple pages I wished I could use Grails features like templates or taglibs.
And of course you can use Grails to generate static html sites. From an old post by Robert Fischer here on the Grails mailing list archive:
If you want to use Grails to generate a static web site, build your website, run grails run-app (locally), and then execute: "wget -m -k http://localhost:8080/yourapp" (assuming you're on a *nix with wget) 
Obviously you have to either refactor the site to use templates and taglibs or start it from scratch that way in the first place. Wget can be used on a Windows system by installing GnuWin32 or UnxUtils. The only issue I've run into is that images specified in css don't get pulled through by that wget command line above, but I just copy over all the resource folders (css, images, javascript) anyway.

No comments :

Post a Comment