Wednesday, July 27, 2011
New Location
Tuesday, May 31, 2011
Nested Go Templates with Dtemplate
Lately I have been playing around with Google's relatively new programming language, Go. So far, I am fairly impressed with the language. It has been pretty easy to pick up. I started playing with it mostly because Google App Engine recently added support. The idea of a compiled language to run a web app seemed appealing. Especially in an environment like App Engine where you pay for CPU time.
While Go as a language is quite capable (and really easy to learn), the template package is somewhat lacking (imo). Specifically, there's no way to nest templates without resorting to a somewhat convoluted method outlined here: http://go.hokapoka.com/example/embedding-or-nesting-go-templates/.
In a web application, it is pretty vital to be able to nest templates. So I created dtemplate. A simple package to allow a user of Go to nest templates in a way that is very similar to how Django handles nested templates. Check out dtemplate on github: https://github.com/greggoryhz/dtemplate. You'll find basic documentation on how to use it there as well.
I haven't yet specified a license, but feel free to use or modify as you please.