Hi,
I just published a new template engine named "amber", (named after jade, node.js template engine)
Why? What?
- It is HAML based. So, all html tags go into indented blocks and attributes can be supplied via css like selctor syntax. (See documentation)
- Compiles to standard Go templates (html/template). Just returns a *Template, ready to be used. It should make things easier for integration, also, I expect the runtime to be highly optimized, as it is built in.
- Supports basic expressions. You can go ahead and print `Friends * 2`, or `2 + 3 * (SomeData % 1)`..
- Supports expressions as attribute conditions. Best example, during an iteration: `.even ? number % 2 == 0` This will add "even" class to the parent html tag, only is the condition holds.
- Expressions require helper functions in generated template's FuncMap. (add, multiple, greater than etc..) These are supplied by amber when you compile an amber template to go template.
- Supports template inheritance. So, it is possible to create a master template, define basic structure and named blocks. And then extend it for different pages, overriding contents of named blocks or just appenfing / prepending content.
- Standard if, else, iterator statements.
I don't know if anyone would be interested, but if you do, keep in mind that it's still experimental. I love Jade on Node.JS so wanted to have something as similar as possible for my Go Projects. I'm also relatively new to Go, so let me know if you have any suggestions.