From: patrick-may@... (Patrick May) Date: 2002-03-20T06:40:49+09:00 Subject: Re: web templating for static sites? Massimiliano Mirra wrote in message news:<20020319153126.B3694@prism.localnet>... > This is a really cool idea, but the very reason I choose static pages > is that I don't have a server to install stuff on and manage to my > heart's content. You can also instantiate the eruby parser in ruby: def compile_eruby (template_filename) File.open (template_filename, "r") { |template| compiler = ERuby::Compiler.new code = compiler.compile_file(template) } code end If you do this within a page object: class Page @template = "path/to/template" def to_html eval( compile_eruby(@template) ) end end Then the code in the template gets eval'd in the scope of the page, and can access the pages information! Tailering the page abstraction to the site, building a save / load functions for the page, you can see where this goes. Pretty lightweight, you're in control of your object hierarchy, and you still get to use a templating solution for the mostly html bits. ~ Patrick